@@ -214,9 +214,7 @@ _M._parse_dsn = _parse_dsn
214214-- @param self raven client
215215-- @param dsn The DSN of the Sentry instance with this format:
216216-- <pre>{PROTOCOL}://{PUBLIC_KEY}:{SECRET_KEY}@{HOST}/{PATH}{PROJECT_ID}</pre>
217- -- Both HTTP protocol and UDP protocol are supported. For example:
218217-- <pre>http://pub:secret@127.0.0.1:8080/sentry/proj-id</pre>
219- -- <pre>udp://pub:secret@127.0.0.1:8080/sentry/proj-id</pre>
220218-- @param conf client configuration. Conf should be a hash table. Possiable
221219-- keys are: "tags", "logger". For example:
222220-- <pre>{ tags = { foo = "bar", abc = "def" }, logger = "myLogger" }</pre>
@@ -390,9 +388,7 @@ function _M.send_report(self, json, conf)
390388
391389 local json_str = json_encode (json )
392390 local ok , err
393- if self .protocol == " udp" then
394- ok , err = self :udp_send (json_str )
395- elseif self .protocol == " http" then
391+ if self .protocol == " http" then
396392 ok , err = self :http_send (json_str )
397393 else
398394 error (" protocol not implemented yet: " .. self .protocol )
@@ -487,44 +483,9 @@ function _M.gen_capture_err(self)
487483 end
488484end
489485
490- -- UDP request template
491- local xsentryauth_udp = " Sentry sentry_version=2.0,sentry_client=%s,"
492- .. " sentry_timestamp=%s,sentry_key=%s,sentry_secret=%s\n\n %s\n "
493-
494486-- HTTP request template
495487local xsentryauth_http = " POST %s HTTP/1.0\r\n Host: %s\r\n Connection: close\r\n Content-Type: application/json\r\n Content-Length: %d\r\n User-Agent: %s\r\n X-Sentry-Auth: Sentry sentry_version=5, sentry_client=%s, sentry_timestamp=%s, sentry_key=%s, sentry_secret=%s\r\n\r\n %s"
496488
497- -- udp_send: actually sends the structured data to the Sentry server using
498- -- UDP
499- function _M .udp_send (self , json_str )
500- local ok , err
501-
502- if not self .sock then
503- local sock = socket .udp ()
504-
505- if sock then
506- ok , err = sock :setpeername (self .host , self .port )
507- if not ok then
508- return nil , err
509- end
510- self .sock = sock
511- end
512- end
513-
514- local bytes
515-
516- if self .sock then
517- local content = string_format (xsentryauth_udp ,
518- self .client_id ,
519- iso8601 (),
520- self .public_key ,
521- self .secret_key ,
522- json_str )
523- bytes , err = self .sock :send (content )
524- end
525- return bytes , err
526- end
527-
528489-- http_send_core: do the actual network send. Expects an already
529490-- connected socket.
530491function _M .http_send_core (self , json_str )
0 commit comments