slidge-whatsapp 0.2.5__cp313-cp313-manylinux_2_36_aarch64.whl → 0.2.6__cp313-cp313-manylinux_2_36_aarch64.whl
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.
Potentially problematic release.
This version of slidge-whatsapp might be problematic. Click here for more details.
- slidge_whatsapp/config.py +3 -0
- slidge_whatsapp/event.go +23 -24
- slidge_whatsapp/gateway.go +13 -9
- slidge_whatsapp/gateway.py +2 -2
- slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.h +181 -181
- slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.so +0 -0
- slidge_whatsapp/generated/build.py +155 -155
- slidge_whatsapp/generated/whatsapp.c +1507 -1507
- slidge_whatsapp/generated/whatsapp.go +907 -907
- slidge_whatsapp/generated/whatsapp.py +1318 -1318
- slidge_whatsapp/generated/whatsapp_go.h +181 -181
- slidge_whatsapp/go.mod +15 -12
- slidge_whatsapp/go.sum +41 -29
- slidge_whatsapp/media/media.go +16 -10
- slidge_whatsapp/session.go +73 -66
- slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn.go +4 -4
- slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_darwin.go +0 -5
- slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +3 -0
- slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols.go +40 -20
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +14 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +2 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/fun.go +10 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_unix.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_windows.go +1 -1
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -7
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/callback.go +2 -1
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +8510 -5090
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +344 -150
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3.go +57 -23
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.c +4 -0
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.go +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/.gitignore +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/LICENSE +202 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/README.md +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid.go +35 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_gccgo.go +26 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.c +23 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.go +22 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.go +35 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.s +18 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.go +28 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.s +44 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_slow.go +24 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_gccgo_go1.8.go +17 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +38 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.5.go +57 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.6.go +43 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.9.go +37 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/CONTRIBUTING.md +43 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/README.md +31 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/console.go +20 -5
- slidge_whatsapp/vendor/github.com/rs/zerolog/log/log.go +131 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/log.go +1 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/sampler.go +4 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/writer.go +9 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupCipher.go +17 -6
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupSessionBuilder.go +17 -7
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/store/SenderKeyStore.go +4 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/chain/ChainKey.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/identity/IdentityKey.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/logger/DefaultLogger.go +2 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/FingerprintProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/LocalStorageProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/WhisperTextProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/session/Session.go +41 -17
- slidge_whatsapp/vendor/go.mau.fi/libsignal/session/SessionCipher.go +64 -30
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/IdentityKeyStore.go +5 -3
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/MessageKeyStore.go +6 -4
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/PreKeyStore.go +6 -4
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SessionStore.go +8 -6
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SignedPreKeyStore.go +7 -5
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/connlog.go +257 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/database.go +309 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/iter.go +233 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/json.go +47 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/log.go +129 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/massinsert.go +164 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/queryhelper.go +137 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/reflectscan.go +30 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/transaction.go +180 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgrades.go +250 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgradetable.go +331 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exerrors/dualerror.go +33 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exerrors/must.go +23 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/cors.go +32 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +64 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +41 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/middleware.go +30 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +37 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +88 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/returnonce.go +25 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/ringbuffer.go +139 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncmap.go +94 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncset.go +136 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/callermarshal.go +28 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/defaults.go +32 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/generics.go +45 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/writer.go +81 -0
- slidge_whatsapp/vendor/go.mau.fi/util/ptr/ptr.go +43 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +27 -26
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/encode.go +4 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/keys.go +5 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +27 -25
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/broadcast.go +5 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +60 -15
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +25 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +45 -19
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +52 -28
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +59 -29
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +166 -146
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +2 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaconn.go +5 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaretry.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +270 -111
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +118 -31
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +67 -36
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +7 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair.go +42 -18
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/prekeys.go +9 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/privacysettings.go +10 -11
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.go +39 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.go +354 -175
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.proto +5 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +158 -15
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.go +29 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.go +13 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.go +344 -31
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.proto +26 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.pb.go → WACompanionReg.pb.go} +170 -84
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.proto → WACompanionReg.proto} +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.go +173 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.go +78 -16
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.proto +5 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +6747 -2230
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +294 -43
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +456 -135
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +14 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.go +162 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.proto +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.go +32 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.proto +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.go +192 -52
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.proto +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.go +60 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.go +39 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.go +61 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1051 -382
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +32 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.go +27 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.go +59 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +382 -78
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +555 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +13 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +29 -19
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +244 -73
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +27 -16
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +3 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +85 -43
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/signal.go +75 -88
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +79 -61
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/lidmap.go +186 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +291 -167
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +153 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/03-message-secrets.sql +11 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/04-privacy-tokens.sql +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/05-account-jid-format.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/06-facebook-uuid.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/07-account-lid.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/08-lid-mapping.sql +5 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/09-decryption-buffer.sql +10 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/upgrades.go +22 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +105 -56
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/botmap.go +210 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/group.go +15 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +7 -8
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +17 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/update.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/upload.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +45 -29
- slidge_whatsapp/vendor/golang.org/x/exp/LICENSE +27 -0
- slidge_whatsapp/vendor/golang.org/x/exp/PATENTS +22 -0
- slidge_whatsapp/vendor/golang.org/x/exp/constraints/constraints.go +54 -0
- slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/guts.go +50 -0
- slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/.gitignore +2 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/ascii.go +53 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/ciphers.go +641 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/client_conn_pool.go +311 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +122 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +61 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/databuffer.go +149 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/errors.go +145 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/flow.go +120 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +1702 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +170 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/encode.go +245 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/hpack.go +523 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/tables.go +403 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +432 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/pipe.go +184 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +3350 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +20 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +3287 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/unencrypted.go +32 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/write.go +381 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched.go +251 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_priority.go +451 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_random.go +77 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_roundrobin.go +119 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/go118.go +13 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/idna10.0.0.go +769 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/idna9.0.0.go +717 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/pre_go118.go +11 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/punycode.go +217 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables10.0.0.go +4559 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables11.0.0.go +4653 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables12.0.0.go +4733 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables13.0.0.go +4959 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables9.0.0.go +4486 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie.go +51 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie12.0.0.go +30 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie13.0.0.go +30 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trieval.go +119 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/request.go +467 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +148 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux.go +16 -26
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +84 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +20 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +84 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +20 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/security_windows.go +44 -5
- slidge_whatsapp/vendor/golang.org/x/sys/windows/syscall_windows.go +4 -2
- slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +239 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +9 -0
- slidge_whatsapp/vendor/golang.org/x/text/LICENSE +27 -0
- slidge_whatsapp/vendor/golang.org/x/text/PATENTS +22 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule.go +336 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +11 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +14 -0
- slidge_whatsapp/vendor/golang.org/x/text/transform/transform.go +709 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/core.go +1071 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +1815 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +1887 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +1923 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go +1955 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +1781 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/composition.go +512 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/forminfo.go +279 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/input.go +109 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/iter.go +458 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/normalize.go +610 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +7657 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +7693 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +7710 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +7760 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +7637 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/transform.go +88 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/trie.go +54 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +3 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +16 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/{strings_unsafe_go121.go → strings_unsafe.go} +0 -2
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/proto/merge.go +6 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +2 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/{value_unsafe_go121.go → value_unsafe.go} +0 -2
- slidge_whatsapp/vendor/modules.txt +38 -13
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/METADATA +1 -1
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/RECORD +293 -180
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/WHEEL +1 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/CNAME +0 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/_config.yml +0 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.raw +0 -23
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.raw +0 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WAWebProtobufsCompanionReg.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go +0 -296
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go +0 -94
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go +0 -98
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/LICENSE +0 -0
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.6.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
// Copyright 2025 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
package httpcommon
|
|
6
|
+
|
|
7
|
+
import (
|
|
8
|
+
"context"
|
|
9
|
+
"errors"
|
|
10
|
+
"fmt"
|
|
11
|
+
"net/http/httptrace"
|
|
12
|
+
"net/textproto"
|
|
13
|
+
"net/url"
|
|
14
|
+
"sort"
|
|
15
|
+
"strconv"
|
|
16
|
+
"strings"
|
|
17
|
+
|
|
18
|
+
"golang.org/x/net/http/httpguts"
|
|
19
|
+
"golang.org/x/net/http2/hpack"
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
var (
|
|
23
|
+
ErrRequestHeaderListSize = errors.New("request header list larger than peer's advertised limit")
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
// Request is a subset of http.Request.
|
|
27
|
+
// It'd be simpler to pass an *http.Request, of course, but we can't depend on net/http
|
|
28
|
+
// without creating a dependency cycle.
|
|
29
|
+
type Request struct {
|
|
30
|
+
URL *url.URL
|
|
31
|
+
Method string
|
|
32
|
+
Host string
|
|
33
|
+
Header map[string][]string
|
|
34
|
+
Trailer map[string][]string
|
|
35
|
+
ActualContentLength int64 // 0 means 0, -1 means unknown
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// EncodeHeadersParam is parameters to EncodeHeaders.
|
|
39
|
+
type EncodeHeadersParam struct {
|
|
40
|
+
Request Request
|
|
41
|
+
|
|
42
|
+
// AddGzipHeader indicates that an "accept-encoding: gzip" header should be
|
|
43
|
+
// added to the request.
|
|
44
|
+
AddGzipHeader bool
|
|
45
|
+
|
|
46
|
+
// PeerMaxHeaderListSize, when non-zero, is the peer's MAX_HEADER_LIST_SIZE setting.
|
|
47
|
+
PeerMaxHeaderListSize uint64
|
|
48
|
+
|
|
49
|
+
// DefaultUserAgent is the User-Agent header to send when the request
|
|
50
|
+
// neither contains a User-Agent nor disables it.
|
|
51
|
+
DefaultUserAgent string
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// EncodeHeadersParam is the result of EncodeHeaders.
|
|
55
|
+
type EncodeHeadersResult struct {
|
|
56
|
+
HasBody bool
|
|
57
|
+
HasTrailers bool
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// EncodeHeaders constructs request headers common to HTTP/2 and HTTP/3.
|
|
61
|
+
// It validates a request and calls headerf with each pseudo-header and header
|
|
62
|
+
// for the request.
|
|
63
|
+
// The headerf function is called with the validated, canonicalized header name.
|
|
64
|
+
func EncodeHeaders(ctx context.Context, param EncodeHeadersParam, headerf func(name, value string)) (res EncodeHeadersResult, _ error) {
|
|
65
|
+
req := param.Request
|
|
66
|
+
|
|
67
|
+
// Check for invalid connection-level headers.
|
|
68
|
+
if err := checkConnHeaders(req.Header); err != nil {
|
|
69
|
+
return res, err
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if req.URL == nil {
|
|
73
|
+
return res, errors.New("Request.URL is nil")
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
host := req.Host
|
|
77
|
+
if host == "" {
|
|
78
|
+
host = req.URL.Host
|
|
79
|
+
}
|
|
80
|
+
host, err := httpguts.PunycodeHostPort(host)
|
|
81
|
+
if err != nil {
|
|
82
|
+
return res, err
|
|
83
|
+
}
|
|
84
|
+
if !httpguts.ValidHostHeader(host) {
|
|
85
|
+
return res, errors.New("invalid Host header")
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// isNormalConnect is true if this is a non-extended CONNECT request.
|
|
89
|
+
isNormalConnect := false
|
|
90
|
+
var protocol string
|
|
91
|
+
if vv := req.Header[":protocol"]; len(vv) > 0 {
|
|
92
|
+
protocol = vv[0]
|
|
93
|
+
}
|
|
94
|
+
if req.Method == "CONNECT" && protocol == "" {
|
|
95
|
+
isNormalConnect = true
|
|
96
|
+
} else if protocol != "" && req.Method != "CONNECT" {
|
|
97
|
+
return res, errors.New("invalid :protocol header in non-CONNECT request")
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Validate the path, except for non-extended CONNECT requests which have no path.
|
|
101
|
+
var path string
|
|
102
|
+
if !isNormalConnect {
|
|
103
|
+
path = req.URL.RequestURI()
|
|
104
|
+
if !validPseudoPath(path) {
|
|
105
|
+
orig := path
|
|
106
|
+
path = strings.TrimPrefix(path, req.URL.Scheme+"://"+host)
|
|
107
|
+
if !validPseudoPath(path) {
|
|
108
|
+
if req.URL.Opaque != "" {
|
|
109
|
+
return res, fmt.Errorf("invalid request :path %q from URL.Opaque = %q", orig, req.URL.Opaque)
|
|
110
|
+
} else {
|
|
111
|
+
return res, fmt.Errorf("invalid request :path %q", orig)
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Check for any invalid headers+trailers and return an error before we
|
|
118
|
+
// potentially pollute our hpack state. (We want to be able to
|
|
119
|
+
// continue to reuse the hpack encoder for future requests)
|
|
120
|
+
if err := validateHeaders(req.Header); err != "" {
|
|
121
|
+
return res, fmt.Errorf("invalid HTTP header %s", err)
|
|
122
|
+
}
|
|
123
|
+
if err := validateHeaders(req.Trailer); err != "" {
|
|
124
|
+
return res, fmt.Errorf("invalid HTTP trailer %s", err)
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
trailers, err := commaSeparatedTrailers(req.Trailer)
|
|
128
|
+
if err != nil {
|
|
129
|
+
return res, err
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
enumerateHeaders := func(f func(name, value string)) {
|
|
133
|
+
// 8.1.2.3 Request Pseudo-Header Fields
|
|
134
|
+
// The :path pseudo-header field includes the path and query parts of the
|
|
135
|
+
// target URI (the path-absolute production and optionally a '?' character
|
|
136
|
+
// followed by the query production, see Sections 3.3 and 3.4 of
|
|
137
|
+
// [RFC3986]).
|
|
138
|
+
f(":authority", host)
|
|
139
|
+
m := req.Method
|
|
140
|
+
if m == "" {
|
|
141
|
+
m = "GET"
|
|
142
|
+
}
|
|
143
|
+
f(":method", m)
|
|
144
|
+
if !isNormalConnect {
|
|
145
|
+
f(":path", path)
|
|
146
|
+
f(":scheme", req.URL.Scheme)
|
|
147
|
+
}
|
|
148
|
+
if protocol != "" {
|
|
149
|
+
f(":protocol", protocol)
|
|
150
|
+
}
|
|
151
|
+
if trailers != "" {
|
|
152
|
+
f("trailer", trailers)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
var didUA bool
|
|
156
|
+
for k, vv := range req.Header {
|
|
157
|
+
if asciiEqualFold(k, "host") || asciiEqualFold(k, "content-length") {
|
|
158
|
+
// Host is :authority, already sent.
|
|
159
|
+
// Content-Length is automatic, set below.
|
|
160
|
+
continue
|
|
161
|
+
} else if asciiEqualFold(k, "connection") ||
|
|
162
|
+
asciiEqualFold(k, "proxy-connection") ||
|
|
163
|
+
asciiEqualFold(k, "transfer-encoding") ||
|
|
164
|
+
asciiEqualFold(k, "upgrade") ||
|
|
165
|
+
asciiEqualFold(k, "keep-alive") {
|
|
166
|
+
// Per 8.1.2.2 Connection-Specific Header
|
|
167
|
+
// Fields, don't send connection-specific
|
|
168
|
+
// fields. We have already checked if any
|
|
169
|
+
// are error-worthy so just ignore the rest.
|
|
170
|
+
continue
|
|
171
|
+
} else if asciiEqualFold(k, "user-agent") {
|
|
172
|
+
// Match Go's http1 behavior: at most one
|
|
173
|
+
// User-Agent. If set to nil or empty string,
|
|
174
|
+
// then omit it. Otherwise if not mentioned,
|
|
175
|
+
// include the default (below).
|
|
176
|
+
didUA = true
|
|
177
|
+
if len(vv) < 1 {
|
|
178
|
+
continue
|
|
179
|
+
}
|
|
180
|
+
vv = vv[:1]
|
|
181
|
+
if vv[0] == "" {
|
|
182
|
+
continue
|
|
183
|
+
}
|
|
184
|
+
} else if asciiEqualFold(k, "cookie") {
|
|
185
|
+
// Per 8.1.2.5 To allow for better compression efficiency, the
|
|
186
|
+
// Cookie header field MAY be split into separate header fields,
|
|
187
|
+
// each with one or more cookie-pairs.
|
|
188
|
+
for _, v := range vv {
|
|
189
|
+
for {
|
|
190
|
+
p := strings.IndexByte(v, ';')
|
|
191
|
+
if p < 0 {
|
|
192
|
+
break
|
|
193
|
+
}
|
|
194
|
+
f("cookie", v[:p])
|
|
195
|
+
p++
|
|
196
|
+
// strip space after semicolon if any.
|
|
197
|
+
for p+1 <= len(v) && v[p] == ' ' {
|
|
198
|
+
p++
|
|
199
|
+
}
|
|
200
|
+
v = v[p:]
|
|
201
|
+
}
|
|
202
|
+
if len(v) > 0 {
|
|
203
|
+
f("cookie", v)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
continue
|
|
207
|
+
} else if k == ":protocol" {
|
|
208
|
+
// :protocol pseudo-header was already sent above.
|
|
209
|
+
continue
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
for _, v := range vv {
|
|
213
|
+
f(k, v)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
if shouldSendReqContentLength(req.Method, req.ActualContentLength) {
|
|
217
|
+
f("content-length", strconv.FormatInt(req.ActualContentLength, 10))
|
|
218
|
+
}
|
|
219
|
+
if param.AddGzipHeader {
|
|
220
|
+
f("accept-encoding", "gzip")
|
|
221
|
+
}
|
|
222
|
+
if !didUA {
|
|
223
|
+
f("user-agent", param.DefaultUserAgent)
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Do a first pass over the headers counting bytes to ensure
|
|
228
|
+
// we don't exceed cc.peerMaxHeaderListSize. This is done as a
|
|
229
|
+
// separate pass before encoding the headers to prevent
|
|
230
|
+
// modifying the hpack state.
|
|
231
|
+
if param.PeerMaxHeaderListSize > 0 {
|
|
232
|
+
hlSize := uint64(0)
|
|
233
|
+
enumerateHeaders(func(name, value string) {
|
|
234
|
+
hf := hpack.HeaderField{Name: name, Value: value}
|
|
235
|
+
hlSize += uint64(hf.Size())
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
if hlSize > param.PeerMaxHeaderListSize {
|
|
239
|
+
return res, ErrRequestHeaderListSize
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
trace := httptrace.ContextClientTrace(ctx)
|
|
244
|
+
|
|
245
|
+
// Header list size is ok. Write the headers.
|
|
246
|
+
enumerateHeaders(func(name, value string) {
|
|
247
|
+
name, ascii := LowerHeader(name)
|
|
248
|
+
if !ascii {
|
|
249
|
+
// Skip writing invalid headers. Per RFC 7540, Section 8.1.2, header
|
|
250
|
+
// field names have to be ASCII characters (just as in HTTP/1.x).
|
|
251
|
+
return
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
headerf(name, value)
|
|
255
|
+
|
|
256
|
+
if trace != nil && trace.WroteHeaderField != nil {
|
|
257
|
+
trace.WroteHeaderField(name, []string{value})
|
|
258
|
+
}
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
res.HasBody = req.ActualContentLength != 0
|
|
262
|
+
res.HasTrailers = trailers != ""
|
|
263
|
+
return res, nil
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
// IsRequestGzip reports whether we should add an Accept-Encoding: gzip header
|
|
267
|
+
// for a request.
|
|
268
|
+
func IsRequestGzip(method string, header map[string][]string, disableCompression bool) bool {
|
|
269
|
+
// TODO(bradfitz): this is a copy of the logic in net/http. Unify somewhere?
|
|
270
|
+
if !disableCompression &&
|
|
271
|
+
len(header["Accept-Encoding"]) == 0 &&
|
|
272
|
+
len(header["Range"]) == 0 &&
|
|
273
|
+
method != "HEAD" {
|
|
274
|
+
// Request gzip only, not deflate. Deflate is ambiguous and
|
|
275
|
+
// not as universally supported anyway.
|
|
276
|
+
// See: https://zlib.net/zlib_faq.html#faq39
|
|
277
|
+
//
|
|
278
|
+
// Note that we don't request this for HEAD requests,
|
|
279
|
+
// due to a bug in nginx:
|
|
280
|
+
// http://trac.nginx.org/nginx/ticket/358
|
|
281
|
+
// https://golang.org/issue/5522
|
|
282
|
+
//
|
|
283
|
+
// We don't request gzip if the request is for a range, since
|
|
284
|
+
// auto-decoding a portion of a gzipped document will just fail
|
|
285
|
+
// anyway. See https://golang.org/issue/8923
|
|
286
|
+
return true
|
|
287
|
+
}
|
|
288
|
+
return false
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// checkConnHeaders checks whether req has any invalid connection-level headers.
|
|
292
|
+
//
|
|
293
|
+
// https://www.rfc-editor.org/rfc/rfc9114.html#section-4.2-3
|
|
294
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.2.2-1
|
|
295
|
+
//
|
|
296
|
+
// Certain headers are special-cased as okay but not transmitted later.
|
|
297
|
+
// For example, we allow "Transfer-Encoding: chunked", but drop the header when encoding.
|
|
298
|
+
func checkConnHeaders(h map[string][]string) error {
|
|
299
|
+
if vv := h["Upgrade"]; len(vv) > 0 && (vv[0] != "" && vv[0] != "chunked") {
|
|
300
|
+
return fmt.Errorf("invalid Upgrade request header: %q", vv)
|
|
301
|
+
}
|
|
302
|
+
if vv := h["Transfer-Encoding"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && vv[0] != "chunked") {
|
|
303
|
+
return fmt.Errorf("invalid Transfer-Encoding request header: %q", vv)
|
|
304
|
+
}
|
|
305
|
+
if vv := h["Connection"]; len(vv) > 0 && (len(vv) > 1 || vv[0] != "" && !asciiEqualFold(vv[0], "close") && !asciiEqualFold(vv[0], "keep-alive")) {
|
|
306
|
+
return fmt.Errorf("invalid Connection request header: %q", vv)
|
|
307
|
+
}
|
|
308
|
+
return nil
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
func commaSeparatedTrailers(trailer map[string][]string) (string, error) {
|
|
312
|
+
keys := make([]string, 0, len(trailer))
|
|
313
|
+
for k := range trailer {
|
|
314
|
+
k = CanonicalHeader(k)
|
|
315
|
+
switch k {
|
|
316
|
+
case "Transfer-Encoding", "Trailer", "Content-Length":
|
|
317
|
+
return "", fmt.Errorf("invalid Trailer key %q", k)
|
|
318
|
+
}
|
|
319
|
+
keys = append(keys, k)
|
|
320
|
+
}
|
|
321
|
+
if len(keys) > 0 {
|
|
322
|
+
sort.Strings(keys)
|
|
323
|
+
return strings.Join(keys, ","), nil
|
|
324
|
+
}
|
|
325
|
+
return "", nil
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// validPseudoPath reports whether v is a valid :path pseudo-header
|
|
329
|
+
// value. It must be either:
|
|
330
|
+
//
|
|
331
|
+
// - a non-empty string starting with '/'
|
|
332
|
+
// - the string '*', for OPTIONS requests.
|
|
333
|
+
//
|
|
334
|
+
// For now this is only used a quick check for deciding when to clean
|
|
335
|
+
// up Opaque URLs before sending requests from the Transport.
|
|
336
|
+
// See golang.org/issue/16847
|
|
337
|
+
//
|
|
338
|
+
// We used to enforce that the path also didn't start with "//", but
|
|
339
|
+
// Google's GFE accepts such paths and Chrome sends them, so ignore
|
|
340
|
+
// that part of the spec. See golang.org/issue/19103.
|
|
341
|
+
func validPseudoPath(v string) bool {
|
|
342
|
+
return (len(v) > 0 && v[0] == '/') || v == "*"
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
func validateHeaders(hdrs map[string][]string) string {
|
|
346
|
+
for k, vv := range hdrs {
|
|
347
|
+
if !httpguts.ValidHeaderFieldName(k) && k != ":protocol" {
|
|
348
|
+
return fmt.Sprintf("name %q", k)
|
|
349
|
+
}
|
|
350
|
+
for _, v := range vv {
|
|
351
|
+
if !httpguts.ValidHeaderFieldValue(v) {
|
|
352
|
+
// Don't include the value in the error,
|
|
353
|
+
// because it may be sensitive.
|
|
354
|
+
return fmt.Sprintf("value for header %q", k)
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return ""
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// shouldSendReqContentLength reports whether we should send
|
|
362
|
+
// a "content-length" request header. This logic is basically a copy of the net/http
|
|
363
|
+
// transferWriter.shouldSendContentLength.
|
|
364
|
+
// The contentLength is the corrected contentLength (so 0 means actually 0, not unknown).
|
|
365
|
+
// -1 means unknown.
|
|
366
|
+
func shouldSendReqContentLength(method string, contentLength int64) bool {
|
|
367
|
+
if contentLength > 0 {
|
|
368
|
+
return true
|
|
369
|
+
}
|
|
370
|
+
if contentLength < 0 {
|
|
371
|
+
return false
|
|
372
|
+
}
|
|
373
|
+
// For zero bodies, whether we send a content-length depends on the method.
|
|
374
|
+
// It also kinda doesn't matter for http2 either way, with END_STREAM.
|
|
375
|
+
switch method {
|
|
376
|
+
case "POST", "PUT", "PATCH":
|
|
377
|
+
return true
|
|
378
|
+
default:
|
|
379
|
+
return false
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// ServerRequestParam is parameters to NewServerRequest.
|
|
384
|
+
type ServerRequestParam struct {
|
|
385
|
+
Method string
|
|
386
|
+
Scheme, Authority, Path string
|
|
387
|
+
Protocol string
|
|
388
|
+
Header map[string][]string
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
// ServerRequestResult is the result of NewServerRequest.
|
|
392
|
+
type ServerRequestResult struct {
|
|
393
|
+
// Various http.Request fields.
|
|
394
|
+
URL *url.URL
|
|
395
|
+
RequestURI string
|
|
396
|
+
Trailer map[string][]string
|
|
397
|
+
|
|
398
|
+
NeedsContinue bool // client provided an "Expect: 100-continue" header
|
|
399
|
+
|
|
400
|
+
// If the request should be rejected, this is a short string suitable for passing
|
|
401
|
+
// to the http2 package's CountError function.
|
|
402
|
+
// It might be a bit odd to return errors this way rather than returing an error,
|
|
403
|
+
// but this ensures we don't forget to include a CountError reason.
|
|
404
|
+
InvalidReason string
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
func NewServerRequest(rp ServerRequestParam) ServerRequestResult {
|
|
408
|
+
needsContinue := httpguts.HeaderValuesContainsToken(rp.Header["Expect"], "100-continue")
|
|
409
|
+
if needsContinue {
|
|
410
|
+
delete(rp.Header, "Expect")
|
|
411
|
+
}
|
|
412
|
+
// Merge Cookie headers into one "; "-delimited value.
|
|
413
|
+
if cookies := rp.Header["Cookie"]; len(cookies) > 1 {
|
|
414
|
+
rp.Header["Cookie"] = []string{strings.Join(cookies, "; ")}
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
// Setup Trailers
|
|
418
|
+
var trailer map[string][]string
|
|
419
|
+
for _, v := range rp.Header["Trailer"] {
|
|
420
|
+
for _, key := range strings.Split(v, ",") {
|
|
421
|
+
key = textproto.CanonicalMIMEHeaderKey(textproto.TrimString(key))
|
|
422
|
+
switch key {
|
|
423
|
+
case "Transfer-Encoding", "Trailer", "Content-Length":
|
|
424
|
+
// Bogus. (copy of http1 rules)
|
|
425
|
+
// Ignore.
|
|
426
|
+
default:
|
|
427
|
+
if trailer == nil {
|
|
428
|
+
trailer = make(map[string][]string)
|
|
429
|
+
}
|
|
430
|
+
trailer[key] = nil
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
delete(rp.Header, "Trailer")
|
|
435
|
+
|
|
436
|
+
// "':authority' MUST NOT include the deprecated userinfo subcomponent
|
|
437
|
+
// for "http" or "https" schemed URIs."
|
|
438
|
+
// https://www.rfc-editor.org/rfc/rfc9113.html#section-8.3.1-2.3.8
|
|
439
|
+
if strings.IndexByte(rp.Authority, '@') != -1 && (rp.Scheme == "http" || rp.Scheme == "https") {
|
|
440
|
+
return ServerRequestResult{
|
|
441
|
+
InvalidReason: "userinfo_in_authority",
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
var url_ *url.URL
|
|
446
|
+
var requestURI string
|
|
447
|
+
if rp.Method == "CONNECT" && rp.Protocol == "" {
|
|
448
|
+
url_ = &url.URL{Host: rp.Authority}
|
|
449
|
+
requestURI = rp.Authority // mimic HTTP/1 server behavior
|
|
450
|
+
} else {
|
|
451
|
+
var err error
|
|
452
|
+
url_, err = url.ParseRequestURI(rp.Path)
|
|
453
|
+
if err != nil {
|
|
454
|
+
return ServerRequestResult{
|
|
455
|
+
InvalidReason: "bad_path",
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
requestURI = rp.Path
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return ServerRequestResult{
|
|
462
|
+
URL: url_,
|
|
463
|
+
NeedsContinue: needsContinue,
|
|
464
|
+
RequestURI: requestURI,
|
|
465
|
+
Trailer: trailer,
|
|
466
|
+
}
|
|
467
|
+
}
|
|
@@ -602,7 +602,150 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI
|
|
|
602
602
|
return
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
-
//sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error)
|
|
605
|
+
// sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error)
|
|
606
|
+
const minIovec = 8
|
|
607
|
+
|
|
608
|
+
func Readv(fd int, iovs [][]byte) (n int, err error) {
|
|
609
|
+
if !darwinKernelVersionMin(11, 0, 0) {
|
|
610
|
+
return 0, ENOSYS
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
iovecs := make([]Iovec, 0, minIovec)
|
|
614
|
+
iovecs = appendBytes(iovecs, iovs)
|
|
615
|
+
n, err = readv(fd, iovecs)
|
|
616
|
+
readvRacedetect(iovecs, n, err)
|
|
617
|
+
return n, err
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
|
|
621
|
+
if !darwinKernelVersionMin(11, 0, 0) {
|
|
622
|
+
return 0, ENOSYS
|
|
623
|
+
}
|
|
624
|
+
iovecs := make([]Iovec, 0, minIovec)
|
|
625
|
+
iovecs = appendBytes(iovecs, iovs)
|
|
626
|
+
n, err = preadv(fd, iovecs, offset)
|
|
627
|
+
readvRacedetect(iovecs, n, err)
|
|
628
|
+
return n, err
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
func Writev(fd int, iovs [][]byte) (n int, err error) {
|
|
632
|
+
if !darwinKernelVersionMin(11, 0, 0) {
|
|
633
|
+
return 0, ENOSYS
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
iovecs := make([]Iovec, 0, minIovec)
|
|
637
|
+
iovecs = appendBytes(iovecs, iovs)
|
|
638
|
+
if raceenabled {
|
|
639
|
+
raceReleaseMerge(unsafe.Pointer(&ioSync))
|
|
640
|
+
}
|
|
641
|
+
n, err = writev(fd, iovecs)
|
|
642
|
+
writevRacedetect(iovecs, n)
|
|
643
|
+
return n, err
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
|
|
647
|
+
if !darwinKernelVersionMin(11, 0, 0) {
|
|
648
|
+
return 0, ENOSYS
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
iovecs := make([]Iovec, 0, minIovec)
|
|
652
|
+
iovecs = appendBytes(iovecs, iovs)
|
|
653
|
+
if raceenabled {
|
|
654
|
+
raceReleaseMerge(unsafe.Pointer(&ioSync))
|
|
655
|
+
}
|
|
656
|
+
n, err = pwritev(fd, iovecs, offset)
|
|
657
|
+
writevRacedetect(iovecs, n)
|
|
658
|
+
return n, err
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
|
|
662
|
+
for _, b := range bs {
|
|
663
|
+
var v Iovec
|
|
664
|
+
v.SetLen(len(b))
|
|
665
|
+
if len(b) > 0 {
|
|
666
|
+
v.Base = &b[0]
|
|
667
|
+
} else {
|
|
668
|
+
v.Base = (*byte)(unsafe.Pointer(&_zero))
|
|
669
|
+
}
|
|
670
|
+
vecs = append(vecs, v)
|
|
671
|
+
}
|
|
672
|
+
return vecs
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
func writevRacedetect(iovecs []Iovec, n int) {
|
|
676
|
+
if !raceenabled {
|
|
677
|
+
return
|
|
678
|
+
}
|
|
679
|
+
for i := 0; n > 0 && i < len(iovecs); i++ {
|
|
680
|
+
m := int(iovecs[i].Len)
|
|
681
|
+
if m > n {
|
|
682
|
+
m = n
|
|
683
|
+
}
|
|
684
|
+
n -= m
|
|
685
|
+
if m > 0 {
|
|
686
|
+
raceReadRange(unsafe.Pointer(iovecs[i].Base), m)
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
func readvRacedetect(iovecs []Iovec, n int, err error) {
|
|
692
|
+
if !raceenabled {
|
|
693
|
+
return
|
|
694
|
+
}
|
|
695
|
+
for i := 0; n > 0 && i < len(iovecs); i++ {
|
|
696
|
+
m := int(iovecs[i].Len)
|
|
697
|
+
if m > n {
|
|
698
|
+
m = n
|
|
699
|
+
}
|
|
700
|
+
n -= m
|
|
701
|
+
if m > 0 {
|
|
702
|
+
raceWriteRange(unsafe.Pointer(iovecs[i].Base), m)
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if err == nil {
|
|
706
|
+
raceAcquire(unsafe.Pointer(&ioSync))
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
func darwinMajorMinPatch() (maj, min, patch int, err error) {
|
|
711
|
+
var un Utsname
|
|
712
|
+
err = Uname(&un)
|
|
713
|
+
if err != nil {
|
|
714
|
+
return
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
var mmp [3]int
|
|
718
|
+
c := 0
|
|
719
|
+
Loop:
|
|
720
|
+
for _, b := range un.Release[:] {
|
|
721
|
+
switch {
|
|
722
|
+
case b >= '0' && b <= '9':
|
|
723
|
+
mmp[c] = 10*mmp[c] + int(b-'0')
|
|
724
|
+
case b == '.':
|
|
725
|
+
c++
|
|
726
|
+
if c > 2 {
|
|
727
|
+
return 0, 0, 0, ENOTSUP
|
|
728
|
+
}
|
|
729
|
+
case b == 0:
|
|
730
|
+
break Loop
|
|
731
|
+
default:
|
|
732
|
+
return 0, 0, 0, ENOTSUP
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
if c != 2 {
|
|
736
|
+
return 0, 0, 0, ENOTSUP
|
|
737
|
+
}
|
|
738
|
+
return mmp[0], mmp[1], mmp[2], nil
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
func darwinKernelVersionMin(maj, min, patch int) bool {
|
|
742
|
+
actualMaj, actualMin, actualPatch, err := darwinMajorMinPatch()
|
|
743
|
+
if err != nil {
|
|
744
|
+
return false
|
|
745
|
+
}
|
|
746
|
+
return actualMaj > maj || actualMaj == maj && (actualMin > min || actualMin == min && actualPatch >= patch)
|
|
747
|
+
}
|
|
748
|
+
|
|
606
749
|
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
|
|
607
750
|
|
|
608
751
|
//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error)
|
|
@@ -705,3 +848,7 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI
|
|
|
705
848
|
//sys write(fd int, p []byte) (n int, err error)
|
|
706
849
|
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
|
|
707
850
|
//sys munmap(addr uintptr, length uintptr) (err error)
|
|
851
|
+
//sys readv(fd int, iovecs []Iovec) (n int, err error)
|
|
852
|
+
//sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error)
|
|
853
|
+
//sys writev(fd int, iovecs []Iovec) (n int, err error)
|
|
854
|
+
//sys pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error)
|