patx/mrhttp-asgi

Version .13 bump

Commit 0d4719d · Mark · 2024-07-18T09:33:46-07:00

Changeset
0d4719d218db12950dad15fb67086d2912e04af6
Parents
9097ecbe075fd36dad432f9bbd7790196ce02deb

View source at this commit

Comments

No comments yet.

Log in to comment

Diff

diff --git a/.gitignore b/.gitignore
index 9582357..993ef13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 *~
 *.o
+*.so
 *.egg-info
 *.egg
 *.eggs
diff --git a/README.md b/README.md
index b83f915..4f94688 100644
--- a/README.md
+++ b/README.md
@@ -64,4 +64,9 @@ sudo apt install python3-dev -y
 pip3 install mrhttp
 ```
 
+Building from source
+
+```
+pip install .
+```
 
diff --git a/setup.py b/setup.py
index d409044..94d9ede 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,7 @@ m1 = Extension(
 
 setup(
   name="mrhttp", 
-  version="0.12",
+  version="0.13",
   license='MIT',
   description='A python web framework written in C',
   long_description=open('README.md').read(),
diff --git a/src/mrhttp/__init__.py b/src/mrhttp/__init__.py
index 1cbc8a7..6949204 100644
--- a/src/mrhttp/__init__.py
+++ b/src/mrhttp/__init__.py
@@ -21,5 +21,5 @@ from .mrcacheclient import MrcacheClient
 from .app import *
 from .internals import randint, escape, to64, from64, timesince
 
-__version__=0.12
+__version__=0.13
 
diff --git a/src/mrhttp/internals/app.c b/src/mrhttp/internals/app.c
index 160c7be..cc8a9d0 100644
--- a/src/mrhttp/internals/app.c
+++ b/src/mrhttp/internals/app.c
@@ -213,7 +213,7 @@ void MrhttpApp_setup_error_pages(MrhttpApp* self) {
   char *body = PyUnicode_AsUTF8AndSize( u, &l );
 
   char *resp = malloc( l + 1024 );
-  sprintf(resp, "HTTP/1.1 404 Not Found\r\nServer: MrHTTP/0.12\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %zu\r\n\r\n", l);
+  sprintf(resp, "HTTP/1.1 404 Not Found\r\nServer: MrHTTP/0.13\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %zu\r\n\r\n", l);
   char *p = resp + strlen(resp);
   memcpy(p, body, l);
 
@@ -225,7 +225,7 @@ void MrhttpApp_setup_error_pages(MrhttpApp* self) {
   body = PyUnicode_AsUTF8AndSize( u, &l );
 
   resp = malloc( l + 1024 );
-  sprintf(resp, "HTTP/1.1 400 Bad Request\r\nServer: MrHTTP/0.12\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %zu\r\n\r\n", l);
+  sprintf(resp, "HTTP/1.1 400 Bad Request\r\nServer: MrHTTP/0.13\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %zu\r\n\r\n", l);
   p = resp + strlen(resp);
   memcpy(p, body, l);
 
diff --git a/src/mrhttp/internals/request.c b/src/mrhttp/internals/request.c
index 2a05100..c8989ed 100644
--- a/src/mrhttp/internals/request.c
+++ b/src/mrhttp/internals/request.c
@@ -1,4 +1,5 @@
 
+
 #include <stddef.h>
 #include <sys/param.h>
 #include <strings.h>
diff --git a/src/mrhttp/internals/response.c b/src/mrhttp/internals/response.c
index 1d17f53..604ae10 100644
--- a/src/mrhttp/internals/response.c
+++ b/src/mrhttp/internals/response.c
@@ -36,7 +36,7 @@ void response_setupResponseBuffer(void) {
   //   Also all 115 and 143s ( updateHeaders )
   s = "HTTP/1.1 200 OK\r\n"; memcpy(p, s, strlen(s)); p += strlen(s);
   s = "Content-Length: 1        \r\n"; memcpy(p, s, strlen(s)); p += strlen(s);
-  s = "Server: MrHTTP/0.12\r\n"; memcpy(p, s, strlen(s)); p += strlen(s);
+  s = "Server: MrHTTP/0.13\r\n"; memcpy(p, s, strlen(s)); p += strlen(s);
   s = "Date: Thu, 05 Apr 2018 22:54:19 GMT\r\n"; memcpy(p, s, strlen(s)); p += strlen(s);
   s = "Content-Type: text/html; charset=utf-8\r\n\r\n"; memcpy(p, s, strlen(s)); p += strlen(s);
   DBG_RESP printf("Init resp buffer:\n%.*s", (int)(p-rbuf), rbuf);
@@ -74,7 +74,7 @@ PyObject *response_updateDate(PyObject *date) {
   Py_ssize_t l;
   char *d = PyUnicode_AsUTF8AndSize( date, &l );
   char *p = rbuf;
-  p += strlen("HTTP/1.1 200 OK\r\n") + strlen("Server: MrHTTP/0.12\r\n") + strlen("Content-Length: 1        \r\n");
+  p += strlen("HTTP/1.1 200 OK\r\n") + strlen("Server: MrHTTP/0.13\r\n") + strlen("Content-Length: 1        \r\n");
   p += 6;
   memcpy(p, d, l);
   Py_RETURN_NONE;
@@ -234,10 +234,10 @@ PyObject *response_getErrorResponse(int code, char *reason, char *msg) {
   sprintf( body, "<html><head><title>%d %s</title></head><body><h1>%s</h1><p>%s</p></body></html>", code, reason, reason, msg );
   int blen = strlen(body);   
   
-  sprintf(p, "HTTP/1.1 %d %s\r\nServer: MrHTTP/0.12\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %d\r\n", code, reason, blen);
+  sprintf(p, "HTTP/1.1 %d %s\r\nServer: MrHTTP/0.13\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %d\r\n", code, reason, blen);
   p += strlen(p);
   memcpy(p, 
-         rbuf + strlen("HTTP/1.1 200 OK\r\n") + strlen("Server: MrHTTP/0.12\r\n") + strlen("Content-Length: 17       \r\n"), 
+         rbuf + strlen("HTTP/1.1 200 OK\r\n") + strlen("Server: MrHTTP/0.13\r\n") + strlen("Content-Length: 17       \r\n"), 
          strlen("Date: Thu, 05 Apr 2018 22:54:19 GMT\r\n"));
   p += strlen("Date: Thu, 05 Apr 2018 22:54:19 GMT\r\n");