mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-05 05:01:36 +00:00
another bunch of portings
This commit is contained in:
@@ -3863,22 +3863,6 @@ error:
|
||||
return -1;
|
||||
}
|
||||
|
||||
void uwsgi_simple_set_status(struct wsgi_request *wsgi_req, int status) {
|
||||
wsgi_req->status = status;
|
||||
}
|
||||
|
||||
void uwsgi_simple_inc_headers(struct wsgi_request *wsgi_req) {
|
||||
wsgi_req->header_cnt++;
|
||||
}
|
||||
|
||||
void uwsgi_simple_response_write(struct wsgi_request *wsgi_req, char *buf, size_t len) {
|
||||
wsgi_req->response_size += wsgi_req->socket->proto_write(wsgi_req, buf, len);
|
||||
}
|
||||
|
||||
void uwsgi_simple_response_write_header(struct wsgi_request *wsgi_req, char *buf, size_t len) {
|
||||
//wsgi_req->headers_size += wsgi_req->socket->proto_write_header(wsgi_req, buf, len);
|
||||
}
|
||||
|
||||
ssize_t uwsgi_simple_request_read(struct wsgi_request *wsgi_req, char *buf, size_t len) {
|
||||
if (wsgi_req->post_cl == 0)
|
||||
return 0;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
#include "../../uwsgi.h"
|
||||
#include <uwsgi.h>
|
||||
|
||||
extern struct uwsgi_server uwsgi;
|
||||
|
||||
static int uwsgi_echo_request(struct wsgi_request *wsgi_req) {
|
||||
|
||||
int uwsgi_echo_request(struct wsgi_request *wsgi_req) {
|
||||
|
||||
wsgi_req->response_size = wsgi_req->socket->proto_write(wsgi_req, wsgi_req->buffer, wsgi_req->uh.pktsize);
|
||||
|
||||
return 0;
|
||||
return uwsgi_response_write_body_do(wsgi_req, wsgi_req->buffer, wsgi_req->uh.pktsize);
|
||||
}
|
||||
|
||||
struct uwsgi_plugin echo_plugin = {
|
||||
|
||||
@@ -114,22 +114,11 @@ int uwsgi_routing_func_basicauth(struct wsgi_request *wsgi_req, struct uwsgi_rou
|
||||
}
|
||||
|
||||
forbidden:
|
||||
/*
|
||||
iov[1].iov_base = " 401 Authorization Required\r\nWWW-Authenticate: Basic realm=\"";
|
||||
iov[1].iov_len = 60 ;
|
||||
|
||||
iov[2].iov_base = ur->data;
|
||||
iov[2].iov_len = ur->data_len;
|
||||
|
||||
iov[3].iov_base = "\"\r\n\r\n";
|
||||
iov[3].iov_len = 5;
|
||||
|
||||
wsgi_req->headers_size = wsgi_req->socket->proto_writev_header(wsgi_req, iov, 4);
|
||||
|
||||
wsgi_req->response_size = wsgi_req->socket->proto_write(wsgi_req,"Unauthorized", 12);
|
||||
*/
|
||||
|
||||
wsgi_req->status = 401;
|
||||
uwsgi_response_prepare_headers(wsgi_req, "401 Authorization Required", 26);
|
||||
char *realm = uwsgi_concat3n("Basic realm=\"", 13, ur->data, ur->data_len, "\"", 1);
|
||||
uwsgi_response_add_header(wsgi_req, "WWW-Authenticate", 16, realm, 13 + ur->data_len + 1);
|
||||
free(realm);
|
||||
uwsgi_response_write_body_do(wsgi_req, "Unauthorized", 12);
|
||||
|
||||
return UWSGI_ROUTE_BREAK;
|
||||
}
|
||||
|
||||
@@ -3675,10 +3675,6 @@ char *uwsgi_matheval_str(char *);
|
||||
int uwsgi_kvlist_parse(char *, size_t, char, char, ...);
|
||||
int uwsgi_send_http_stats(int);
|
||||
|
||||
void uwsgi_simple_response_write(struct wsgi_request *, char *, size_t);
|
||||
void uwsgi_simple_response_write_header(struct wsgi_request *, char *, size_t);
|
||||
void uwsgi_simple_set_status(struct wsgi_request *, int status);
|
||||
void uwsgi_simple_inc_headers(struct wsgi_request *);
|
||||
ssize_t uwsgi_simple_request_read(struct wsgi_request *, char *, size_t);
|
||||
int uwsgi_plugin_modifier1(char *);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user