diff options
author | Rob Landley <rob@landley.net> | 2006-07-16 12:14:35 +0400 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-07-16 12:14:35 +0400 |
commit | 534374755d618c9c36c9940c82756241c4b25a67 (patch) | |
tree | fac906b4fa40a68c53cecf20215a7a25b3b1cab6 /networking/httpd.c | |
parent | afb94ecf2bb6c53ce2a381d6ce45a426243c76d9 (diff) |
Cleaup read() and write() variants, plus a couple of new functions like
xlseek and fdlength() for the new mkswap.
Diffstat (limited to 'networking/httpd.c')
-rw-r--r-- | networking/httpd.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 4cd09448c..452b56d19 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -961,7 +961,7 @@ static int sendHeaders(HttpResponseNum responseNum) #if DEBUG fprintf(stderr, "Headers: '%s'", buf); #endif - return bb_full_write(a_c_w, buf, len); + return full_write(a_c_w, buf, len); } /**************************************************************************** @@ -1222,7 +1222,7 @@ static int sendCgi(const char *url, break; } } else if(post_readed_size > 0 && FD_ISSET(outFd, &writeSet)) { - count = bb_full_write(outFd, wbuf + post_readed_idx, post_readed_size); + count = full_write(outFd, wbuf + post_readed_idx, post_readed_size); if(count > 0) { post_readed_size -= count; post_readed_idx += count; @@ -1263,14 +1263,14 @@ static int sendCgi(const char *url, rbuf[count] = 0; /* check to see if the user script added headers */ if(strncmp(rbuf, "HTTP/1.0 200 OK\r\n", 4) != 0) { - bb_full_write(s, "HTTP/1.0 200 OK\r\n", 17); + full_write(s, "HTTP/1.0 200 OK\r\n", 17); } if (strstr(rbuf, "ontent-") == 0) { - bb_full_write(s, "Content-type: text/plain\r\n\r\n", 28); + full_write(s, "Content-type: text/plain\r\n\r\n", 28); } firstLine = 0; } - if (bb_full_write(s, rbuf, count) != count) + if (full_write(s, rbuf, count) != count) break; #if DEBUG @@ -1337,8 +1337,8 @@ static int sendFile(const char *url) char *buf = config->buf; sendHeaders(HTTP_OK); - while ((count = bb_full_read(f, buf, MAX_MEMORY_BUFF)) > 0) { - if (bb_full_write(a_c_w, buf, count) != count) + while ((count = full_read(f, buf, MAX_MEMORY_BUFF)) > 0) { + if (full_write(a_c_w, buf, count) != count) break; } close(f); @@ -2000,7 +2000,7 @@ int httpd_main(int argc, char *argv[]) # ifdef CONFIG_FEATURE_HTTPD_SETUID /* drop privileges */ if(uid > 0) - setuid(uid); + xsetuid(uid); # endif #endif |