mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
The HTTP query string wasn't being included in the event.
This commit is contained in:
parent
e6c2d46cd1
commit
e640bf505d
@ -68,7 +68,9 @@ runAcquire act = with act pure
|
||||
tryPlayShip :: FilePath -> IO ()
|
||||
tryPlayShip shipPath = do
|
||||
runAcquire $ do
|
||||
putStrLn "RESUMING SHIP"
|
||||
sls <- Pier.resumed shipPath serfFlags
|
||||
putStrLn "SHIP RESUMED"
|
||||
Pier.pier shipPath Nothing sls
|
||||
|
||||
tryResume :: FilePath -> IO ()
|
||||
|
@ -241,7 +241,7 @@ mkIpv6 (p, q, r, s) = Ipv6 (pBits .|. qBits .|. rBits .|. sBits)
|
||||
sBits = shiftL (fromIntegral s) 96
|
||||
|
||||
reqUrl :: W.Request -> Cord
|
||||
reqUrl = Cord . decodeUtf8 . W.rawPathInfo
|
||||
reqUrl r = Cord $ decodeUtf8 $ W.rawPathInfo r <> W.rawQueryString r
|
||||
|
||||
|
||||
-- Utilities for Constructing Events -------------------------------------------
|
||||
|
@ -39,7 +39,6 @@ nextEv = fmap succ . readIORef . numEvents
|
||||
lastEv :: EventLog -> IO EventId
|
||||
lastEv = readIORef . numEvents
|
||||
|
||||
|
||||
data EventLogExn
|
||||
= NoLogIdentity
|
||||
| MissingEvent EventId
|
||||
@ -194,7 +193,7 @@ clearEvents env eventsTbl =
|
||||
appendEvents :: EventLog -> Vector ByteString -> IO ()
|
||||
appendEvents log !events = do
|
||||
numEvs <- readIORef (numEvents log)
|
||||
next <- nextEv log
|
||||
next <- pure (numEvs + 1)
|
||||
doAppend $ zip [next..] $ toList events
|
||||
writeIORef (numEvents log) (numEvs + word (length events))
|
||||
where
|
||||
@ -311,6 +310,5 @@ putNoun flags txn db key val =
|
||||
putEvent :: MDB_WriteFlags -> Txn -> Dbi -> Word64 -> ByteString -> IO Bool
|
||||
putEvent flags txn db id bs = do
|
||||
withWord64AsMDBval id $ \idVal -> do
|
||||
-- traceM ("putEvent: " <> show (id, length bs))
|
||||
byteStringAsMdbVal bs $ \mVal -> do
|
||||
mdb_put flags txn db idVal mVal
|
||||
|
@ -46,10 +46,9 @@ generateBootSeq ship Pill{..} = do
|
||||
pure $ BootSeq ident pBootFormulas ovums
|
||||
where
|
||||
ident = LogIdentity ship True (fromIntegral $ length pBootFormulas)
|
||||
blip = EvBlip
|
||||
preKern ent = [ blip $ BlipEvTerm $ TermEvBoot (1,()) (Fake (who ident))
|
||||
, blip $ BlipEvArvo $ ArvoEvWhom () ship
|
||||
, blip $ BlipEvArvo $ ArvoEvWack () ent
|
||||
preKern ent = [ EvBlip $ BlipEvTerm $ TermEvBoot (1,()) (Fake (who ident))
|
||||
, EvBlip $ BlipEvArvo $ ArvoEvWhom () ship
|
||||
, EvBlip $ BlipEvArvo $ ArvoEvWack () ent
|
||||
]
|
||||
|
||||
|
||||
@ -75,15 +74,15 @@ writeJobs log !jobs = do
|
||||
|
||||
booted :: FilePath -> FilePath -> Serf.Flags -> Ship
|
||||
-> Acquire (Serf, EventLog, SerfState)
|
||||
booted pillPath top flags ship = do
|
||||
booted pillPath pierPath flags ship = do
|
||||
pill <- liftIO $ loadFile @Pill pillPath >>= \case
|
||||
Left l -> error (show l)
|
||||
Left l -> error (show l) -- TODO Throw a real exception.
|
||||
Right p -> pure p
|
||||
|
||||
seq@(BootSeq ident x y) <- liftIO $ generateBootSeq ship pill
|
||||
|
||||
log <- Log.new (top <> "/.urb/log") ident
|
||||
serf <- Serf.run (Serf.Config top flags)
|
||||
log <- Log.new (pierPath <> "/.urb/log") ident
|
||||
serf <- Serf.run (Serf.Config pierPath flags)
|
||||
|
||||
liftIO $ do
|
||||
(events, serfSt) <- Serf.bootFromSeq serf seq
|
||||
@ -94,7 +93,8 @@ booted pillPath top flags ship = do
|
||||
|
||||
-- Resume an existing ship. ----------------------------------------------------
|
||||
|
||||
resumed :: FilePath -> Serf.Flags -> Acquire (Serf, EventLog, SerfState)
|
||||
resumed :: FilePath -> Serf.Flags
|
||||
-> Acquire (Serf, EventLog, SerfState)
|
||||
resumed top flags = do
|
||||
log <- Log.existing (top <> "/.urb/log")
|
||||
serf <- Serf.run (Serf.Config top flags)
|
||||
|
Loading…
Reference in New Issue
Block a user