From: Matteo Nastasi Date: Sat, 4 Apr 2020 12:40:46 +0000 (+0200) Subject: big cleanup of wrong pasted lines X-Git-Tag: v3.0.1~7 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=193a17d3ad306c050754d6f2137bb5526a7b0535;p=mod-proxy-fdpass.git big cleanup of wrong pasted lines --- diff --git a/mod_proxy_fdpass2.c b/mod_proxy_fdpass2.c index 0b7f1dc..169c5c3 100644 --- a/mod_proxy_fdpass2.c +++ b/mod_proxy_fdpass2.c @@ -262,240 +262,6 @@ static apr_status_t send_socket(apr_pool_t *p, write(mop_fd, mop_bf, strlen(mop_bf)); close(mop_fd); } -#endif - - if (rv == -1) { - return errno; - } - - - return APR_SUCCESS; -} - -static int headers_builder(void *rec, const char *key, const char *value) -{ - char *s; - - s = (char *)rec; - -#if ALTOUT_DEBUG > 1 - { - int mop_fd; - char mop_bf[512]; - - mop_fd = open(ALTOUT_DBG_FILE, O_WRONLY | O_APPEND | O_CREAT, 0644); - sprintf(mop_bf, "HEADERS_BUILDER: [%s:%s]\n", key, value); - write(mop_fd, mop_bf, strlen(mop_bf)); - close(mop_fd); - } -#endif - - // TODO: verify length - // sprintf(s, "%s%s:%s\n", s, key, value); - strcat(s, key); - strcat(s, ":"); - strcat(s, value); - strcat(s, "\n"); -} - -#define CTRL_BUFF_MAX_SZ (8*1024) - -#define DEFAULT_ENCTYPE "application/x-www-form-urlencoded" - -int util_read(request_rec *r, const char **rbuf) -{ - int rc; - - if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) { - return rc; - } - - if (ap_should_client_block(r)) { - char argsbuffer[HUGE_STRING_LEN]; - int rsize, len_read, rpos=0; - long length = r->remaining; - *rbuf = (char *)apr_pcalloc(r->pool, length +1); - if ((len_read = ap_get_client_block(r, argsbuffer, - sizeof(argsbuffer))) > 0) { - if ((rpos + len_read) > length) { - rsize = length - rpos; - } else { - rsize = len_read; - } - - memcpy((char *)*rbuf + rpos, argsbuffer, rsize); - rpos += rsize; - } - - } - - return rc; -} - -int read_post(request_rec *r, const char **data) -{ - const char *type; - char *p, s_type[256]; - int rc = OK; - - s_type[255] = '\0'; -close(mop_fd); -#endif - - if (rv == -1) { - return errno; - } - - - return APR_SUCCESS; -} - -static int headers_builder(void *rec, const char *key, const char *value) -{ - char *s; - - s = (char *)rec; - -#if ALTOUT_DEBUG > 1 - { - int mop_fd; - char mop_bf[512]; - - mop_fd = open(ALTOUT_DBG_FILE, O_WRONLY | O_APPEND | O_CREAT, 0644); - sprintf(mop_bf, "HEADERS_BUILDER: [%s:%s]\n", key, value); - write(mop_fd, mop_bf, strlen(mop_bf)); - close(mop_fd); - } -#endif - - // TODO: verify length - // sprintf(s, "%s%s:%s\n", s, key, value); - strcat(s, key); - strcat(s, ":"); - strcat(s, value); - strcat(s, "\n"); -} - -#define CTRL_BUFF_MAX_SZ (8*1024) - -#define DEFAULT_ENCTYPE "application/x-www-form-urlencoded" - -int util_read(request_rec *r, const char **rbuf) -{ - int rc; - - if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) { - return rc; - } - - if (ap_should_client_block(r)) { - char argsbuffer[HUGE_STRING_LEN]; - int rsize, len_read, rpos=0; - long length = r->remaining; - *rbuf = (char *)apr_pcalloc(r->pool, length +1); - if ((len_read = ap_get_client_block(r, argsbuffer, - sizeof(argsbuffer))) > 0) { - if ((rpos + len_read) > length) { - rsize = length - rpos; - } else { - rsize = len_read; - } - - memcpy((char *)*rbuf + rpos, argsbuffer, rsize); - rpos += rsize; - } - - } - - return rc; -} - -int read_post(request_rec *r, const char **data) -{ - const char *type; - char *p, s_type[256]; - int rc = OK; - - s_type[255] = '\0'; -close(mop_fd); -#endif - - if (rv == -1) { - return errno; - } - - return APR_SUCCESS; -} - -static int headers_builder(void *rec, const char *key, const char *value) -{ - char *s; - - s = (char *)rec; - -#if ALTOUT_DEBUG > 1 - { - int mop_fd; - char mop_bf[512]; - - mop_fd = open(ALTOUT_DBG_FILE, O_WRONLY | O_APPEND | O_CREAT, 0644); - sprintf(mop_bf, "HEADERS_BUILDER: [%s:%s]\n", key, value); - write(mop_fd, mop_bf, strlen(mop_bf)); - close(mop_fd); - } -#endif - - // TODO: verify length - // sprintf(s, "%s%s:%s\n", s, key, value); - strcat(s, key); - strcat(s, ":"); - strcat(s, value); - strcat(s, "\n"); -} - -#define CTRL_BUFF_MAX_SZ (8*1024) - -#define DEFAULT_ENCTYPE "application/x-www-form-urlencoded" - -int util_read(request_rec *r, const char **rbuf) -{ - int rc; - - if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR)) != OK) { - return rc; - } - - if (ap_should_client_block(r)) { - char argsbuffer[HUGE_STRING_LEN]; - int rsize, len_read, rpos=0; - long length = r->remaining; - *rbuf = (char *)apr_pcalloc(r->pool, length +1); - if ((len_read = ap_get_client_block(r, argsbuffer, - sizeof(argsbuffer))) > 0) { - if ((rpos + len_read) > length) { - rsize = length - rpos; - } else { - rsize = len_read; - } - - memcpy((char *)*rbuf + rpos, argsbuffer, rsize); - rpos += rsize; - } - - } - - return rc; -} - -int read_post(request_rec *r, const char **data) -{ - const char *type; - char *p, s_type[256]; - int rc = OK; - - s_type[255] = '\0'; -close(mop_fd); -#endif if (rv == -1) { return errno; @@ -520,7 +286,6 @@ static int headers_builder(void *rec, const char *key, const char *value) write(mop_fd, mop_bf, strlen(mop_bf)); close(mop_fd); } -#endif // TODO: verify length // sprintf(s, "%s%s:%s\n", s, key, value);