@gjsify/http2 0.29.0 → 0.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import"../../_virtual/_rolldown/runtime.js";import{Buffer as e}from"node:buffer";import{closeSync as t,openSync as n,read as r,statSync as i}from"node:fs";const a={respondWithFD(e,t,n){_respondFromFD(this,e,t,n??{},!1)},respondWithFile(e,t,r){let i;try{i=n(e,`r`)}catch(e){if(r?.onError){r.onError(e);return}throw e}_respondFromFD(this,i,t,r??{},!0)}};function _respondFromFD(n,a,o,s,c){let l=typeof a==`number`?a:a.fd,u=l,d={...o};if(s.statCheck)try{let e=i(_fdPath(l)??`/proc/self/fd/`+l);if(s.statCheck(e,d,s)===!1){c&&t(l),n.end();return}}catch(e){if(s.onError){s.onError(e),c&&t(l);return}}let f=Number(d[`:status`]??200);delete d[`:status`];let p={};for(let[e,t]of Object.entries(d))p[e]=typeof t==`number`?String(t):t;n.writeHead(f,p),n.flushHeaders();let m=Math.max(0,s.offset??0),h=s.length,g=64*1024,_=e.alloc(g),v=m,y=typeof h==`number`?h:1/0,b=0,readNext=()=>{if(y<=0){finish();return}r(u,_,0,Math.min(g,y),v,(t,r)=>{if(t){cleanup(t);return}if(r===0){finish();return}v+=r,b+=r,y-=r;let i=e.allocUnsafe(r);_.copy(i,0,0,r),n.write(i)?readNext():n.once(`drain`,readNext)})},finish=()=>{if(n.end(),c)try{t(u)}catch{}},cleanup=e=>{if(s.onError?s.onError(e):n.destroy(e),c)try{t(u)}catch{}};if(y===0){finish();return}readNext()}function _fdPath(e){return typeof e!=`number`||e<0?null:`/proc/self/fd/`+e}function installRespondWithFileMethods(e){Object.assign(e,a)}export{installRespondWithFileMethods};
1
+ import"../../_virtual/_rolldown/runtime.js";import{Buffer as e}from"node:buffer";import{closeSync as t,fstatSync as n,openSync as r,read as i}from"node:fs";const a={respondWithFD(e,t,n){_respondFromFD(this,e,t,n??{},!1)},respondWithFile(e,t,n){let i;try{i=r(e,`r`)}catch(e){if(n?.onError){n.onError(e);return}throw e}_respondFromFD(this,i,t,n??{},!0)}};function _respondFromFD(r,a,o,s,c){let l=typeof a==`number`?a:a.fd,u=l,d={...o};if(s.statCheck)try{let e=n(l);if(s.statCheck(e,d,s)===!1){c&&t(l),r.end();return}}catch(e){if(s.onError){s.onError(e),c&&t(l);return}}let f=Number(d[`:status`]??200);delete d[`:status`];let p={};for(let[e,t]of Object.entries(d))p[e]=typeof t==`number`?String(t):t;r.writeHead(f,p),r.flushHeaders();let m=Math.max(0,s.offset??0),h=s.length,g=64*1024,_=e.alloc(g),v=m,y=typeof h==`number`?h:1/0,b=0,readNext=()=>{if(y<=0){finish();return}i(u,_,0,Math.min(g,y),v,(t,n)=>{if(t){cleanup(t);return}if(n===0){finish();return}v+=n,b+=n,y-=n;let i=e.allocUnsafe(n);_.copy(i,0,0,n),r.write(i)?readNext():r.once(`drain`,readNext)})},finish=()=>{if(r.end(),c)try{t(u)}catch{}},cleanup=e=>{if(s.onError?s.onError(e):r.destroy(e),c)try{t(u)}catch{}};if(y===0){finish();return}readNext()}function installRespondWithFileMethods(e){Object.assign(e,a)}export{installRespondWithFileMethods};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/http2",
3
- "version": "0.29.0",
3
+ "version": "0.31.0",
4
4
  "description": "Node.js http2 module for Gjs",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -33,8 +33,8 @@
33
33
  "http2"
34
34
  ],
35
35
  "devDependencies": {
36
- "@gjsify/cli": "^0.29.0",
37
- "@gjsify/unit": "^0.29.0",
36
+ "@gjsify/cli": "^0.31.0",
37
+ "@gjsify/unit": "^0.31.0",
38
38
  "@types/node": "^25.9.2",
39
39
  "typescript": "^6.0.3"
40
40
  },
@@ -43,9 +43,9 @@
43
43
  "@girs/glib-2.0": "^4.1.0",
44
44
  "@girs/gobject-2.0": "^4.1.0",
45
45
  "@girs/soup-3.0": "^4.1.0",
46
- "@gjsify/events": "^0.29.0",
47
- "@gjsify/http2-native": "^0.29.0",
48
- "@gjsify/utils": "^0.29.0"
46
+ "@gjsify/events": "^0.31.0",
47
+ "@gjsify/http2-native": "^0.31.0",
48
+ "@gjsify/utils": "^0.31.0"
49
49
  },
50
50
  "gjsify": {
51
51
  "runtimes": {