MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / h2_fdpack

Function h2_fdpack

modules/http2d/server.c:508–532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506
507
508static int h2_fdpack(str *data)
509{
510 int rv;
511 ssize_t writelen;
512 int pipefd[2];
513
514 if (!data->s || data->len == 0)
515 return 0;
516
517 rv = pipe(pipefd);
518 if (rv != 0) {
519 LM_ERR("failed to create pipe %d (%s)\n", errno, strerror(errno));
520 return -1;
521 }
522
523 writelen = write(pipefd[1], data->s, data->len);
524 close(pipefd[1]);
525
526 if (writelen != data->len) {
527 close(pipefd[0]);
528 return -1;
529 }
530
531 return pipefd[0];
532}
533
534
535static int on_request_recv(nghttp2_session *session,

Callers 1

on_request_recvFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected