Skip to content

Commit

Permalink
Set status string + fix format string in WS example (CI...)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-canaday committed Dec 2, 2021
1 parent 65a5028 commit cf5d2cd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FLAMBORP="asdf"
YMO_BOX([Init])
# NOTE: This is the PACKAGE version (SemVer), NOT the ABI version (libtool):
AC_INIT(
[libyimmo], [0.0.1],
[libyimmo], [0.0.2],
[[email protected]],[libyimmo],
[https://github.com/andrew-canaday/libyimmo])
AC_CONFIG_AUX_DIR([./build-aux])
Expand Down Expand Up @@ -82,7 +82,7 @@ AC_SUBST([PACKAGE_SUMMARY],["Lightweight socket server framework"])
# - https://autotools.io/libtool/version.html
AC_SUBST([YMO_ABI_CURRENT],[0],[Yimmo libtool ABI current])
AC_SUBST([YMO_ABI_AGE],[0],[Yimmo libtool ABI age])
AC_SUBST([YMO_ABI_REVISION],[1],[Yimmo libtool ABI revision])
AC_SUBST([YMO_ABI_REVISION],[2],[Yimmo libtool ABI revision])
AC_SUBST([YMO_LIB_VERSION],["$YMO_ABI_CURRENT:$YMO_ABI_REVISION:$YMO_ABI_AGE"])

## Package Version:
Expand Down
3 changes: 2 additions & 1 deletion example/ws_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ static ymo_status_t test_ws_recv_cb(
size_t len)
{
if( data && len ) {
ymo_log_info("Recv from %p: \"%*s\"",
ymo_log_info("Recv from %p: \"%.*s\"",
(int)len, data, (void*)session);
return ymo_ws_session_send(
session, flags, YMO_BUCKET_FROM_CPY(data, len));
Expand Down Expand Up @@ -181,6 +181,7 @@ static ymo_status_t test_http_callback(
{
ymo_http_response_set_header(response, "content-type", "text/plain");
ymo_bucket_t* content = YMO_BUCKET_FROM_REF("OK", 2);
ymo_http_response_set_status_str(response, "200 OK");
ymo_http_response_body_append(response, content);
ymo_http_response_finish(response);
return YMO_OKAY;
Expand Down
5 changes: 5 additions & 0 deletions wsgi/ymo_wsgi_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ static ymo_status_t ymo_wsgi_worker_issue_request(

ymo_bucket_t* body_item = NULL;
PyObject* item;
/* TODO: I think this has to be removed for services that might do
* HTTP-based long-polling. Better to check to see if the
* object provides a "len" method and check that. Else, abide
* by the spec.
*/
while((item = PyIter_Next(r_val))) {
/* So, here's the deal: the WSGI spec essentially says "any kind
* of buffering is immoral; if you have it, send it," which is
Expand Down

0 comments on commit cf5d2cd

Please sign in to comment.