Skip to content

Commit bb141c7

Browse files
Squashed commit of the following:
commit 0c10db47c1a4bd41eea30636c5840655595ba99d Author: andrew-canaday <andrew.canaday@gmail.com> Date: Sat Jul 15 13:47:44 2023 -0400 Minor tweaks to docker build + HTTP test. commit df68b7ea95607b8fc0905b7ce70dc15b08595287 Author: andrew-canaday <andrew.canaday@gmail.com> Date: Sat Jul 15 13:46:20 2023 -0400 WSGI: PORT and CONTENT_LENGTH should be string, not int. commit 2df2a0fc6ce201e3d2ef4fad1dc3915802829046 Author: andrew-canaday <andrew.canaday@gmail.com> Date: Sat Jul 15 09:27:58 2023 -0400 Add start_server script for local debug commit d91e6689f405ab9f3a5cb4b36b9c23189eab0f9a Author: andrew-canaday <andrew.canaday@gmail.com> Date: Thu Jul 13 07:50:03 2023 -0400 Use actions checkout/v3 commit d3f8fffe20bc08240a70c6325dcb67c02dfcea80 Author: andrew-canaday <andrew.canaday@gmail.com> Date: Thu Jul 13 07:45:36 2023 -0400 Switch to v2 of docker login action commit 376f612440bc7ff77d0e8c3a06e3600bee7a6e96 Author: andrew-canaday <andrew.canaday@gmail.com> Date: Mon Apr 3 10:01:41 2023 -0400 Update pytest for CI commit c73c63b0e31e2e8ad8658550a59ea75c7166f811 Author: andrew-canaday <andrew.canaday@gmail.com> Date: Wed Mar 29 07:56:57 2023 -0400 Empty commit to prompt CI post RSA key change. commit c09d442a5c4878aec4a7e8e7b186b7e8c3dc5ece Author: andrew-canaday <andrew.canaday@gmail.com> Date: Sat Jul 30 20:39:23 2022 -0400 Fmt code
1 parent 3f1a57a commit bb141c7

File tree

10 files changed

+37
-21
lines changed

10 files changed

+37
-21
lines changed

.github/workflows/configure_make_check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
# Dependencies:
2727
#------------------------------------
2828
- name: Checkout libbsat
29-
uses: actions/checkout@v2
29+
uses: actions/checkout@v3
3030
with:
3131
repository: 'andrew-canaday/libbsat'
3232
path: 'libbsat'
@@ -49,7 +49,7 @@ jobs:
4949
# Checkout, configure, make, run tests, and make dist for libyimmo:
5050
#--------------------------------------------------------------------
5151
- name: Checkout libyimmo
52-
uses: actions/checkout@v2
52+
uses: actions/checkout@v3
5353
with:
5454
repository: ${{ github.repository }}
5555
path: 'libyimmo'

.github/workflows/create_release_on_tag.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
# Dependencies:
3030
#------------------------------------
3131
- name: Checkout libbsat
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v3
3333
with:
3434
repository: 'andrew-canaday/libbsat'
3535
path: 'libbsat'
@@ -55,7 +55,7 @@ jobs:
5555
# - signing
5656
#--------------------------------------------------------------------
5757
- name: Checkout libyimmo
58-
uses: actions/checkout@v2
58+
uses: actions/checkout@v3
5959
with:
6060
fetch-depth: 0
6161
repository: ${{ github.repository }}
@@ -105,7 +105,7 @@ jobs:
105105
shell: bash
106106
steps:
107107
- name: Log in to Docker Hub
108-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
108+
uses: docker/login-action@v2
109109
with:
110110
username: ${{ secrets.DOCKERHUB_USERNAME }}
111111
password: ${{ secrets.DOCKERHUB_PASSWORD }}

.github/workflows/docker_wsgi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
shell: bash
1515
steps:
1616
- name: Log in to Docker Hub
17-
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
17+
uses: docker/login-action@v2
1818
with:
1919
username: ${{ secrets.DOCKERHUB_USERNAME }}
2020
password: ${{ secrets.DOCKERHUB_PASSWORD }}

.github/workflows/server-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
1818
steps:
1919
- name: Checkout libyimmo
20-
uses: actions/checkout@v2
20+
uses: actions/checkout@v3
2121
with:
2222
repository: ${{ github.repository }}
2323
path: 'libyimmo'
@@ -64,7 +64,7 @@ jobs:
6464
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
6565
steps:
6666
- name: Checkout libyimmo
67-
uses: actions/checkout@v2
67+
uses: actions/checkout@v3
6868
with:
6969
repository: ${{ github.repository }}
7070
path: 'libyimmo'
@@ -140,7 +140,7 @@ jobs:
140140
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
141141
steps:
142142
- name: Checkout libyimmo
143-
uses: actions/checkout@v2
143+
uses: actions/checkout@v3
144144
with:
145145
repository: ${{ github.repository }}
146146
path: 'libyimmo'
@@ -191,7 +191,7 @@ jobs:
191191
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
192192
steps:
193193
- name: Checkout libyimmo
194-
uses: actions/checkout@v2
194+
uses: actions/checkout@v3
195195
with:
196196
repository: ${{ github.repository }}
197197
path: 'libyimmo'
@@ -262,7 +262,7 @@ jobs:
262262
IMAGE_NAME: "ghcr.io/${{ github.repository }}-ci:${{ github.ref_name }}"
263263
steps:
264264
- name: Checkout libyimmo
265-
uses: actions/checkout@v2
265+
uses: actions/checkout@v3
266266
with:
267267
repository: ${{ github.repository }}
268268
path: 'libyimmo'

.github/workflows/valgrind.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
# Dependencies:
3131
#------------------------------------
3232
- name: Checkout libbsat
33-
uses: actions/checkout@v2
33+
uses: actions/checkout@v3
3434
with:
3535
repository: 'andrew-canaday/libbsat'
3636
path: 'libbsat'
@@ -53,7 +53,7 @@ jobs:
5353
# Build libyimmo:
5454
#--------------------------------------------------------------------
5555
- name: Checkout libyimmo
56-
uses: actions/checkout@v2
56+
uses: actions/checkout@v3
5757
with:
5858
repository: ${{ github.repository }}
5959
path: 'libyimmo'

ci/http/test_http_1_0_basic.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ test_expect_100_continue() {
7979
EXPECT_STATUS="200" \
8080
ctest -0 \
8181
-H 'Expect: 100-continue' \
82-
--data-binary "${0}" \
82+
--data-binary "@${0}" \
8383
"${YMO_HTTP_TEST_URL_ROOT}/echo/body"
8484
}
8585

ci/start-server.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
IMAGE_NAME="${IMAGE_NAME:-"yimmo-ci-test:local"}"
4+
5+
docker run \
6+
--name yimmo-wsgi-server \
7+
-e YIMMO_LOG_LEVEL=${YIMMO_LOG_LEVEL:-"INFO"} \
8+
-e YIMMO_WSGI_NO_PROC=2 \
9+
-e YIMMO_WSGI_NO_THREADS=2 \
10+
-p 8081:8081 \
11+
$IMAGE_NAME
12+
13+
# EOF

docker/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@ RUN apt-get -qq install -y \
3939

4040
RUN pip3 install flask
4141

42-
ADD . /opt/src/libyimmo
4342
RUN cd /opt/src && git clone https://github.com/andrew-canaday/libbsat
4443
RUN cd /opt/src/libbsat && ./autogen.sh
45-
RUN cd /opt/src/libyimmo && ./autogen.sh
46-
4744
RUN cd /opt/build/bsat \
4845
&& /opt/src/libbsat/configure \
4946
--silent \
5047
--enable-silent-rules \
5148
&& make install
5249

50+
ADD . /opt/src/libyimmo
51+
RUN cd /opt/src/libyimmo && ./autogen.sh
52+
5353

5454
#-------------------------------------------------------------------------------
5555
# Test base:
@@ -59,7 +59,8 @@ FROM yimmo-deps AS yimmo-test
5959
ENV YIMMO_SERVER_IDLE_TIMEOUT=2.0
6060
RUN cd /opt/build/yimmo \
6161
&& /opt/src/libyimmo/configure \
62-
--enable-examples --enable-wsgi \
62+
--enable-examples \
63+
--enable-wsgi \
6364
CFLAGS="-DYMO_LOG_LEVEL_MAX=6 -DYMO_LOG_LEVEL_DEFAULT=3" \
6465
YMO_WS_FRAME_MAX=0xffffffffffffffff \
6566
&& make \

wsgi/ymo_wsgi_context.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ yimmo_context_t* ymo_wsgi_ctx_update_environ(PyObject* pEnviron, ymo_wsgi_exchan
455455
}
456456
if( request->content_length ) {
457457
YMO_DECREF_PYDICT_SETITEM(pEnviron, pEnvironKeyContentLength,
458-
PyLong_FromSize_t(request->content_length));
458+
PyUnicode_FromFormat("%zu", request->content_length));
459459
}
460460
ymo_wsgi_ctx_update_bail:
461461
ymo_wsgi_session_unlock(exchange->session);

wsgi/ymo_wsgi_mod.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,11 @@ ymo_status_t ymo_wsgi_init(ymo_wsgi_proc_t* w_proc)
192192

193193
/* PEP 3333: */
194194
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SERVER_NAME", PyUnicode_FromString("yimmo-wsgi"));
195-
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SERVER_PORT", PyLong_FromLong(w_proc->port));
195+
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SERVER_PORT", PyUnicode_FromFormat("%i", w_proc->port));
196196
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SERVER_PROTOCOL", pUrlScheme);
197-
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SCRIPT_NAME", PyUnicode_FromString(w_proc->module));
197+
198+
/* TODO: set from env? */
199+
//YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "SCRIPT_NAME", PyUnicode_FromString(w_proc->module));
198200

199201
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "wsgi.version", pWsgiVersion);
200202
YMO_INCREF_PYDICT_SETITEM_STRING(pCommonEnviron, "wsgi.errors", pStderr); /* HACK! */

0 commit comments

Comments
 (0)