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;
write(mop_fd, mop_bf, strlen(mop_bf));
close(mop_fd);
}
-#endif
// TODO: verify length
// sprintf(s, "%s%s:%s\n", s, key, value);