aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/actors/interconnect/packet.cpp
blob: 55c96794148b3bbbb4595ae5a7e80da98be3f037 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "packet.h"

#include <library/cpp/actors/core/probes.h> 
 
#include <util/system/datetime.h>

LWTRACE_USING(ACTORLIB_PROVIDER); 
 
ui32 TEventHolder::Fill(IEventHandle& ev) {
    Serial = 0;
    Descr.Type = ev.Type;
    Descr.Flags = ev.Flags;
    Descr.Recipient = ev.Recipient;
    Descr.Sender = ev.Sender;
    Descr.Cookie = ev.Cookie;
    ev.TraceId.Serialize(&Descr.TraceId);
    ForwardRecipient = ev.GetForwardOnNondeliveryRecipient();
    EventActuallySerialized = 0;
    Descr.Checksum = 0;

    if (ev.HasBuffer()) {
        Buffer = ev.ReleaseChainBuffer();
        EventSerializedSize = Buffer->GetSize();
    } else if (ev.HasEvent()) {
        Event.Reset(ev.ReleaseBase());
        EventSerializedSize = Event->CalculateSerializedSize();
    } else {
        EventSerializedSize = 0;
    }
 
    return EventSerializedSize;
}