diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-07-13 00:08:00 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-07-13 09:56:06 +0000 |
commit | 22a718de33fef78bab33bc00e52cd230c22e1945 (patch) | |
tree | 2ea15384aac63ffb808c05adc3bc2edce86ab05e /http_dav.c | |
parent | ec096dc8de3d37f4e33e7bc47bcfbe5207ae6855 (diff) | |
download | cmogstored-22a718de33fef78bab33bc00e52cd230c22e1945.tar.gz |
This makes it easier to write tapsets which key objects by: PID,FD for uniqueness. This also avoids some mog_fd_of() calls.
Diffstat (limited to 'http_dav.c')
-rw-r--r-- | http_dav.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -15,7 +15,7 @@ void mog_http_delete(struct mog_fd *mfd, char *buf) char *path; if (mfd->fd_type == MOG_FD_TYPE_HTTPGET) { - mog_http_resp(http, "405 Method Not Allowed", true); + mog_http_resp(mfd, "405 Method Not Allowed", true); return; } @@ -26,7 +26,7 @@ void mog_http_delete(struct mog_fd *mfd, char *buf) rc = mog_unlink(http->svc, path); if (rc == 0) { - mog_http_resp(http, "204 No Content", true); + mog_http_resp(mfd, "204 No Content", true); return; } @@ -35,14 +35,14 @@ void mog_http_delete(struct mog_fd *mfd, char *buf) case EISDIR: case EACCES: forbidden: - mog_http_resp(http, "403 Forbidden", true); + mog_http_resp(mfd, "403 Forbidden", true); return; case ENOENT: - mog_http_resp(http, "404 Not Found", true); + mog_http_resp(mfd, "404 Not Found", true); return; } PRESERVE_ERRNO(do { - mog_http_resp(http, "500 Internal Server Error", true); + mog_http_resp(mfd, "500 Internal Server Error", true); } while(0)); } @@ -52,7 +52,7 @@ void mog_http_mkcol(struct mog_fd *mfd, char *buf) char *path; if (mfd->fd_type == MOG_FD_TYPE_HTTPGET) { - mog_http_resp(http, "405 Method Not Allowed", true); + mog_http_resp(mfd, "405 Method Not Allowed", true); return; } path = mog_http_path(http, buf); @@ -64,7 +64,7 @@ void mog_http_mkcol(struct mog_fd *mfd, char *buf) * this. */ if (path) - mog_http_resp(http, "400 Bad Request", true); + mog_http_resp(mfd, "400 Bad Request", true); else /* path traversal attack */ - mog_http_resp(http, "403 Forbidden", true); + mog_http_resp(mfd, "403 Forbidden", true); } |