-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWorkREADME.txt
2756 lines (2295 loc) · 111 KB
/
WorkREADME.txt
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Done:
=====
a) The Exit from GUI is not clean. It SEGVs on destructors. So as of
now am having a brute force exit(0) on a QUIT from GUI.
This is outdated => d) is used now.
b) Hang at start - fixed - check comments in XChange.cpp:registerThread()
c) Implemented /me
d) Exit from GUI revisited.
All threads, when reading from the Q, immediately on getting data.
should check first if QUIT is triggered. If so, then quit.
So when we QUIT from GUI, we populate all the queues with a dummy message.
e) Created a ToTrigger Thread. It basically reads from the
ToTrigger Q. This Q is populated by the FromServerThr on channel messages
which are potential xdcc file messages or FServe triggers.
The ToTrigger Thread actions will be as below:
If its a xdcc file line -> update FilesList structure.
If its a FServ trigger ->
Check if its already in FServWaitingNicks. If so, ignore.
If not, add it in FServWaitingNicks, and issue the trigger,
by populating, toServerQ (slow drain)
sleep 2 minutes.
Note: FServWaitingNicks class is used only by the ToTrigger Thread,
and is not manipulated by any other outside Thread -> need not have
mutexes or be available globally in XChange.
f) Have to implement a FServParse class which will parse
the line as FServ or XDCC or valid etc.
Make a test case for this and test it first.
g) Implemented a SpamFilter class. To not show spam related PRIVMSGs.
It basically will hold a list of regular expressions against which all
PRIVMSG, ACTION, NOTICE will pass through.
h) Have to start the DCCServer Thread listening on port 8124.
i) Integrated DCCserver/DCC chat. And made them extract directory listings.
j) Have to implement the Memory Debugging Class. Its coredumping cause of
memory corruption sometimes. Look into this with high proprity.
LeakTracer class is born.
k) Remove ExitThread() calls, and let them exit out of scope, helps in
calling the destructors and freeing up memory.
Nov 6th = no memory corruption and no memory leaks.
l) when some characters are present in the InputText widget. And we move
to a different tabs. It triggers a Enter key press in that widget, causing
half assed messages to be sent.
m) InActive window to change color to red on new text arrival. Normal color
to be blue text.
n) Pressing Tab does nick completion like mirc.
o) Have implemented the FilesDetailList Class for storing all the scanned
Files XDCC/FSERV.
Functions for searching are yet to be implemented.
p) Have a 10 line history of entered text. Scrollable with up and down arrow.
Class HistoryLines . Test file also created.
r) Have to implement a Stack Trace Class for debugging crashes.
Class StackTrace created derived from HistoryLines. Test case also created.
s) Added sort etc to FilesDetailList class.
t) Need to fine tune the FilesDetailList class. Currently it auto prunes files
which are 1 hour old. This will cause the Class to not hold valid file
data for a nick, after prune, and till its trigger is seen next.
Hence what we could do is, as soon as a nick's trigger is seen, we update
the time on all his files, in the FilesDetailList Class. We also maintain
a count of how many times the 'time' is being updated. After a certain
number of updates, say 20, the filesOfNickPresent() should delete their
entries. prune() continues to prune if time is older than pruneTime. (1 hr)
u) Break ThreadMain.cpp into files = 1 for each thread.
v) How the Search list interacts with other components.
The components in play are:
1. Search List (selecting and double clicking on a line is the trigger)
2. Downloads In Progress (Actual bytes are being transferred)
3. Downloads In Queue (Queued in various servers)
4. Downloads In Limbo (Trying to figure out how to get these files)
So as soon as I double click on a file in the Search List. The events that
occur are as below:
The FileName and FileSize are dumped in the Downloads in Limbo UI.
Which also is associated with a XChange object, which maintains a
list of Files/Size info, which is fed to a Thread.
This thread, lets call it the Download Initiator(DwnldInitThr).
It waits on a Q called UI_ToDwnldInit
which is in the XChange. This Line from the Q, has file size and
file name information. It queries the FilesDB object, to give it a
list of nicks/trigger information for just that Filesize/filename.
=> FilesDB.getFilesDetailListMatchingFileAndSize(...)
It works on that list serially attempting to get the download of the
file started (1st preference), or get it in some sort of Q. On not
being able to succeed, we as of now, discard the attempt.
Two scenarios:
a) xdcc trigger => update the Download waiting nicks datastructure
with nick and file name infomation, so that the DCC or DCCSERVER
send is accepted.
=> update the Notice waiting nicks datastructure with nick and
filename information, so that the NOTICE regarding Q or transfer
or denied is accepted.
If its a download, then the Download In Progress UI is updated
appropriately.
If its a Q, then the Download in Q UI is updated appropriately.
if its a reject, remove the Nick and Filename from the
Notice waiting nicks datastructure.
b) fserv trigger => update the waiting nicks datastructure with
nick and filename/dir information, so that the DCC or DCCSERVER
chat is accepted.
The DCC/DCCServer Chat component, establishes the connection,
if succesful, and requests the files. That component, also
registers wether server is sending now or putting in Q or
denying and updates the information in the UIs as section a)
=> Implemented the Thr and the Q it feeds on. Got the double click to
feed the Q.
Before trying out each way to get the file, we check
if the file is being transferred by looking at the DwnldInProgress
structure (which is same as WaitingNick structure)
All of the below will be in XChange, and be a FServWaitingNicks structure.
FServWaitingNicks, will hold FileName, FileSize, Trigger, Nick info.
This helps the DCCServerThr, in deciding what to allow. Also on issuing
trigger the DCCThr will know if it needs to issue a GET in addition to
doing the regular DIR command.
DwnldWaiting
DwnldInProgress
FServPending
When a CHAT is issued and FServ Pending has the Nick listed with Filename
, dir etc information. We issue a GET. If FileName is NULL its a DIR.
Before issuing a GET, we add the info in the DwnldWaiting, just so
that if it sends immediately we dont refuse it.
We note down the servers response. If it is "Sending ...", then its OK.
If its, "You are in Q ...", then its OK. For everything else, we remove
the entry from DwnldWaiting.
We remove entry from FServPending and our job is done.
On receiving NOTICE from the server, we check if its from a Nick present
in DwnldWaiting. If so, we update the various DwnldWaiting UI
component appropriately.
=> Added DwnldWaiting, DwnldInProgress in XChange.
Response from FServ when issued a GET.
Sending File. (in red color)
Adding your file to queue slot 1. The file will send when the next send slot is open.
That file has already been queued in slot 1!
Looks like FServWaitingNicks is becoming more like FilesDetailList
Have to replace FServWaitingNicks with FilesDetailList and tweak
FilesDetailList. Also add a Queue number in the structure.
Also while pruning, we can remember last prune timestamp, and not
prune if last pruning was done say 10 seconds ago.
This is done. <-====
w) Have our longIP ready to be used in the global area along with
So send a USERHOST on connect. Make changes in IRCLineInterpret
to classify the 302 reply correctly.
x) In FilesDetailList add function init() which initialises an allocated
FilesDetail
y) A TimerThr().
This does the below duties:
1. Sending Trigger when appropriate.
2. Keep track of Total Upload Speed.
3. Keep track of Total Download Speed.
4. Current # of Sends.
5. Current # of Gets.
6. Initiating a Send if appropriate from the QueuesInProgress structure.
7. Send To_UI() commands to update the appropriate UIs with information.
z) File Server implementation - Thread FileServerThr
Our Trigger is [/ctcp <nick> Masala Of <nick>]
Try workaround file serving first. (outgoing connection)
then try normal DCC (incoming connection)
DCCServer doubles as DCC too. This gives us a new set of problems.
When an incoming connection gets established in the DCCServer, it
needs to decide, what to feed that connection ? a) DCC Send a file ?
b) DCC CHAT a File Server ? c) DCCSERVER CHAT (remote nick giving us
CHAT/FileServer)? d) DCCSERVER Get a file ? (remote nick sending us
a file)?
a) and b) are applicable when we are FILE SERVING.
c) and d) are applicable when we are LEECHING.
For File Server:
As a solution we will save the dotted ip of user in the
DottedIP field of FileServerWaiting. That way, a lookup for the dotted
ip will yield us a hit and the Nick and provide validation.
The disadvantage of this method is that all users should not have
host masking. It will fail if host masking is enabled.
Add FilesDetailList function getFilesDetailListOfDottedIP()
For DCC Send:
We will have solution along same lines above. The Structure used will
be DCCSendWaiting.
a) Transfer Threads will attach the TCPConnect structure they
are using to do the actual transfer, to the appropriate FilesDetailList
ex: DwnldInProgress, UploadInProgress. Hence when they transfer the
BytesSent/BytesReceived will be auto avaiable in the FilesDetailList.
As the pointer is going to be saved, it can cause a bit of problem:
- TimerThr gets list of FilesDetail.
- goes thru the List and adds the speeds from individual
TCPConnect pointers.
- The actual download/upload Thr which is using the TCPConnect, is
done its job and destroys the TCPConnect.
- TimerThr, acceses that same TCPConnect, which now is non existent.
=> SEGV.
Hence when search...(*) returns a list of FDs, we make sure that the
TCPConnect related values of BytesSent, BytesReceived, and Born Time
are copied over seperately in the FilesDetail structure.
b) Take care of nick changes in all FilesDetailList structure.
Similarly the parts/quits/kicks.
c) Respond to !list <nick> and Respond if a hit for @find <search>
d) Use CHANNEL_MAIN, CHANNEL_CHAT
For QUIT, check InfoLine if it has QUIT in it, then its a wanted Quit.
For other kinds of quit, dont delete the guy from qs and sends.
Parts and Kicks, should effect sends/queues only if they
happen in CHANNEL_MAIN.
e) when we are not joined in CHANNEL_MAIN, do not try to attempt a
send from queues in TimerThr.cpp
f) Disable detailed queues. But enable detailed sends.
g) The FilesDetail orders the list in ascending order. And search returns
that list in descending order. For Queues, we shouldnt be having them
in order, but strictly append. So introduce one more private variable
called bool Sort. default is set to true. For the FileServer Q we turn
it to false.
i) While Exiting if a File Server is connected, am not able to disconnect
it. Dont know if its cause of the select that its waiting on ?
It doesnt even printDebug() when called, so possibly not even calling
disConnect. The pointer is the same used in Fileserve and the one in
FileServerInProgress.
Also note that the FileServerInProgress and FileServerInQueue part
does not fill up when accessing the file server in the UI tab.
This was bug in copyFilesDetail when used by search. - fixed.
j) Implement priority to anyone other than a regular user.
k) Dont give File Server to people who are already in the process or already
in the File Server.
l) If the sender has one connection in state TIME_WAIT and then tries to
connect to the same port again, it fails. Have to find out why its in
TIME_WAIT when the socket was closed.
To reproduce, keep sending same file again and again. After 5th time
we hit this issue. Also confirmed that after the TIME_WAIT connection
disappears the next send succeeds. In this discussion Sender is mirc
on remote machine and receiver is masalamate
Changed TCPConnect, so that its shutdown and then closes sockets.
When accessing mirc's fileserver, it doesnt close its file serving
chat session properly and hence on its side there lingers a TIME_WAIT
even after we are done with our end.
On 6.14, this stops the next file server access or the GET.
On 6.16, even though TIME_WAIT lingers, the connection gets established,
and hence all is OK.
m) Addition in FileSearch UI. Probably it should also search for by nick,
if it doesnt get any hit when it does a search.
Also Add a header called Nick after the FileSize.
n) onHelpAbout() completed.
o) double clicking on a Download In Progress, gives an option to cancel it.
p) Make text gray on black background. Changed all RGB 255,255,255 to
RGB 211,211,211
q) In message: "Please unmask your host" Add the personalised command too.
ie: Please unmask your host by typing: /mode -v nickname
s) In Messages window, /clear will clear nick list and text window.
In all other windows, clear only text.
t) graceful shutdown as in windows:
1. shutdown with how = SD_SEND.
2. call recv() till zero returned or SOCKET_ERROR
3. call closesocket().
This should be tested with 6.14 serving workaround.
No improvement with 6.14. The only thing we can do is when accessing
the file server, and issuing the GET, if the response we get is Sending...
then we delay the QUIT by 10 seconds, so that it attempts to connect
us and succeeds. (as we havent discoed the server yet, for it to become
TIME_WAIT)
u) A nick on being kicked from CHANNEL_MAIN, didnt get its download cancelled.
r) If KICKED, PARTED, QUIT, disconnect the FileServerInProgress too.
s) Before starting a download or FileServer, make sure nick is in
CHANNEL_MAIN
(Dec 8 2004)
t) When a Send gets disconnected, cause of Errors, put it back in the
end of the queues.
This wont recurse, as we wont put in q if send slots are open.
u) Settings - Read on startup. Save on changes.
Sections that would be present are:
[IRC]
Nick=String
[Connection]
How=DIRECT | BNC | WINGATE | SOCKS4 | SOCKS5 | PROXY
Host=String
Port=Integer
User=String
Password=String
VHost=String
[FServe]
Queue1=Nick DottedIP FileName
Queue2=Nick DottedIP FileName
...
Queue12=Nick DottedIP FileName
There are 12 cause of 2 sends and 10 queues.
With FileName, we get the FD from MyFilesDB, and then drop it in
QueuesInProgress.
For the Queues, we need the Nick's DottedIP as well.
v) Exit from FileServer saying Thread not registered from
XChange::resetIRC_Nick_Changed -> Thread not registered.
Have to mutex protect the ThreadCount usage.
Also bug in updating ThreadCount.
w) Double clicking on the Waiting Tab should present an option to cancel
that Queue and remove it from that list. (DwnldWaiting)
x) Move fully downloaded file to the Serving folder and update MyFilesDB
y) Implemented clr_queues in the FileServer.
z) Only initiate a download, if we dont already have it in the Serving
folder.
a) The Rate of Download or Upload should additionally be in rolling 20
second window as that is required by Torrent.
b) Each time a queue is added, update cfg file with that information.
c) Add SHA1 class, for piece checksums for torrents.
d) Take care of TOPIC changes.
e) If nick in use, try a different nick.
f) In Options menu, reflect the right data we currently hold.
g) When canceling a download, send /ctcp <nick> NoReSend, so that it doesnt
resend.
h) Let only one instance of the program run.
i) Identify nick, if password is given.
j) Added the icon on the left corner of title. Get a nice .gif file for it
now. (transparency)
k) In the put semaphores there is bug:
current order is : mutexlock, putline, semaup, mutexrelease
it should be : mutexlock, putline, mutexrelease, semaup
l) Get the mutex and semaphore inside the LineQueue Class
then we wont need any additional wrapper on top of it in XChange.cpp
It can exist like the FilesDetailList class.
m) Add SHA1File Class to take care of generation of SHA1 of pieces etc
of files in the Serving directory.
n) Make trace file be generated in SERVING_BASE_DIR so that I can download
it for analysis.
o) MetaInfo file only obtained from server using the command:
metainfo filename
The server can possibly reply in the DCC Chat connection itself.
using a special format.
1st line:
FileSize FileSHA1 PayloadSHA1 FileName
2nd line:
payload size in bytes of forthcoming piece wise SHA1
<size bytes of piecewise SHA1>
It automatically quits after that.
If it doenst have the metainfo information. It replies with:
Error:
It doesnt quit automatically.
Where do we save the metainfo file and what name do we give it ?
Save it in "Serving" directory.
Name it: .filename
If we already have such a file in the "Serving" directory, implies
we dont need to get it again.
The MyFilesDB generation checks and updates the "Serving" directory
with the .filename file for all files therein. This implies that all partial
files are always in "Partial". Its only moved to "Serving" when its
downloaded fully.
Format of .filename file:
FileSize FileSHA1 PayloadSHA1 FileName\n
<payload size>\n
<payload length bytes of piecewise SHA1>
This is exactly the info passed on when "metainfo filename" is issued in
the fileserver.
The piecewise SHA1 = 20 bytes per 128 KB
This translates to: 160 bytes for each 1 MB.
So payload size:
128 KB = 20 bytes
FileSize = (FileSize / 128 KB) * 20 bytes. = (shift right by 17) * 20
is (FileSize / 128 KB) * 20 bytes
Where do we save the bitmap of the pieces we have obtained ? possibly in
the partial downloading file in the "Partial" directory. (towards the end
past the filesize).
p) On double clicking on nick, sometimes crash. (Bug - resolved)
q) on pressing Tab in Search String window - crash.
bug in TabBookWindow::onExpandTextEntry()
r) When the mouse press is released, make focus go to the TextEntry widget.
Above has a problem, now cant copy paste from simplescroll.
so when we release, first we copy the text, then move focus.
so call ScrollUI->onCmdCopySel(), before moving focus.
s) A new command called, "/portcheck Nick" to be created
that sends a /ctcp to that nick with portcheck (only if Nick is present
in main). This will prompt that nick to try to open a connection at
portnum
It replies back with success or failure
t) Add /msg support. Should work just like in mirc.
u) Add /ctcp support. Assumes its a trigger access, and hence will do all
arrangements assuming an FServ access will take place.
v) Add "help" in FServ command.
w) The meta files which are created, make them hidden under WINDOWS.
Its a . file under unix, which is hidden anyway.
x) save MasalaMate.trace as MasalaMate.pid.trc. This will help in downloading
the trace files, from all the core dumping nicks.
Jan 7th
y) Make the structures in XChange, be accessible easier. Rather than having
the Thread array etc.
The functions are:
isIRC_CM_Changed()
isIRC_SL_Changed()
isIRC_CL_Changed()
isIRC_Nick_Changed()
isIRC_Server_Changed()
isIRC_IP_Changed()
Now we can change these functions, so that they pass the structure they
are checking for the change as an argument. Based on that they return
true or false. With this approach, everything can remain the same.
And, register/unregister can be discarded.
Jan 8th
z) Have a single point srand(getpid()) in IRCClient.run()
Remove from everywhere else.
Jan 8th
a) The Channel list and Server List are structures which are static
once set in our case. Hence lets not repeatedly check for them to change
in IRCCLient.cpp
Jan 8th
b) In the Tab for File search, list all files, without removing repetitions.
Jan 8th
c) Also, when double clicking, only get that file from that nick.
For this we change DwnldInitThr, so that it now looks for Nick and
FileName. It previously looked at Size and FileName.
Jan 8th
d) Increase the history of lines to 20000 from 10000.
Jan 8th
e) In the trace file, mention the Client name and version number.
Jan 9th
f) Initialised Nick local variable in the various threads. Was done to avoid,
access of uninitialised variables.
Jan 9th
g) Increased char array from 128 to 512 in the update(download/fserv/waiting)
functions in TabBook
Jan 9th
h) Change IRCNickLists Class to hold client information and IP information.
Jan 11th
i) DCCThr(), now handles IC_USERHOST. as will be used in manual dcc send.
Jan 11th
j) Add manual dcc send. Should send immediately.
syntax: /dcc send nick
We first check if we have nick's ip in NickList. If not, we issue a
/userhost and hope that the ip is populated.
We present the user with the file list selection dialog, and then on
getting a file to send, we first check if its ip is known. If not known
we inform the user. (possible failures are: nick not in known channel,
nick is not mode -v, nick's host could not be resolved, or havent got
reply back from an issued USERHOST)
All files in any directory should be able to be sent.
For that, start using the DirName field in FilesDetail.
Manual DCC sends, will have an appropriate directory set.
if DirName is NULL => SERVING_BASE_DIR
Jan 13th
k) All sends are initiated purely by TimerThr.cpp. Hence add a field
in FilesDetail which mentions a manual send. They are cumpolsorily at
index 1. So TimerThr, will look at index 1 too and push it out
if its a DCC manual send.
Jan 13th
l) Add more statistics like record cps, bytes sent etc in trigger ad,
like sysreset.
Add RecordCPS as double in XChange.
Add TotalBytesSent as double in XChange.
RecordCPS comparison is done every 5 seconds in TimerThr.cpp
with call to Helper::updateRecordCPS()
TotalBytesSent is incremented in TransferThr.
Values are Loaded at startup. (Helper::readConfigFile())
Its values are written out when the FServ Config section is updated.
Incorporate these values in the FServ ad.
Jan 13th
m) The trace files, when requested, should be sent immediately.
Just like a manual dcc send.
Jan 13th
n) Add more statistics: Record CPS Up|Down: [] Bytes Sent|Rcvd: []
Jan 14th
o) Add UPNP support. Class Upnp.
We have a UpnpThr.cpp which handles it.
Communication with it is done using LineQueue IRC_ToUpnp;
We will define the commands that it will take in.
It in turn, can use XChange to update the UI.
Commands:
1. SEARCH
2. GET_EXTERNAL_IP
3. GET_CURRENT_PORT_MAPPINGS
4. ADD_PORT_MAPPING <port> <descrip>
5. DEL_PORT_MAPPING <port> <descrip>
6. SEARCH_IF_NOT_OK // Issued only by TimerThr once a minute or so.
// It does a Search only if Status is not UPNP_OK.
We can incorporate a /upnp command to initiate these.
/upnp search
/upnp getextip
/upnp getmappings
/upnp addport <port>
/upnp delport <port> // will not allow DCCSERVER_PORT to be deleted
Automatically, we will do SEARCH, ADD for 8124, and DEL for 8124 on exit.
Jan 18th
p) Add File->Partial Dir to open the directory holding Partially downloading
files.
Add File->Serving Dir to open the directory holding the Serving files.
Jan 18th
q) on receiving a portcheck request, works only 1st time.
Jan 18th
r) A Help window, to provide help.
Jan 19th
s) Added a Clock in the Menubar.
Jan 19th
t) Crash in TCPConnect->getUploadBPS();
The scenario is: FileServer Tab was being updated.
It does a searchFilesDetailList(*) to get the full list.
This search, gets each entry and copies it over.
In copyFilesDetail(), The TCPConnect if present is copied over,
along with calls to UploadBPS(), DownloadBPS() etc.
In the scenario that, the connection is closed and discarded, and
UploadBPS is called, the UploadArray is already destroyed and Nulled.
Leading to a crash.
We need to add a lock() interface in TCPConnect class.
This interface will just stop the Class from being destroyed.
We TCPConnect.lock()
get data and calls we want.
TCPConnect.unlock()
Within a lock and unlock, we are guaranteed that the class wont
be destroyed.
Hence, the destructor, will try to get the lock, before destroying
the class.
Jan 19th
u) Move Help to be next of Dir in menu.
Jan 20th
v) There should be a Mutex to access the common global variables in XChange.
like UploadBps etc. Added XChange->lock() and unlock() to access
those.
Jan 20th
w) User changeable Fonts.
Jan 20th
x) Pass the IC_NOTICE messages for trigger scans just like IC_PRIVMSG.
This will help !list <nick> processing
Also for triggers being issued, update in server window.
Jan 20th
y) To stop the user from doing lot of !list, we do not allow !list at all.
We issue a !list, when we join channel ourselves.
Jan 20th
z) All accesses to FServs in IC_NOTICE, should be considered manual and
immediately accessed, instead of delaying. This takes care of the inital
!list and manually issued !list <nick>
Jan 20th
a) Add Copy/Paste in help file.
Jan 21st
b) While accessing triggers and getting directory information. If no files
present, then add an entry with filename = "No Files Present". This will stop
us from repeatedly accessing his server when an ad is displayed.
Jan 21st
c) Change NODELAY triggers to issue trigger in 15 seconds to avoid
the "Message target change too fast", got from server.
This is IRC Server specific. 15 seems ideal for IRCSuper.
Need to change this when moving to different server.
Add #define IRCSERVER_TARGET_CHANGE_DELAY 15
in ToTriggerThr.cpp
Jan 21st
d) Add entry with filename = "No Files Present" for servers we cannot connect
to. This will help us in not trying the non connectible server again and
again.
The scenario is as follows:
1. I issue the ctcp to access a trigger.
Case I) Remote user tries to contact me at port 8124.
I am firewalled so dont get any connection.
This we cannot detect. And its not much waste of resource,
as we have already issued the ctcp.
Case II) Remote user sends me a DCC CHAT.
I try to connect as per the DCC CHAT, but cant make the connection.
This we definitely can detect.
In this case, we can add entry.
Jan 21st
e) Do not attempt to download FileName = "No Files Present".
Give information in the Server window.
Jan 21st
f) Move #define IRCSERVER_TARGET_CHANGE_DELAY 15
from ToTriggerThr.cpp to ThreadMain.hpp. It is used in DwnldInitThr.cpp
as well, sleeping between two ctcp's which access the trigger.
Jan 21st
h) Lets give more information in server window as we try to retrieve files
by double clicking on GUI.
Jan 21st
i) Remove srand(getpid()) from Helper constructor, as it might keep resetting
the rand generator. We explicitly call srand(getpid(); at the start of each
thread. Hence we just add it in TRACE_INIT(); and keep one in IRCClient.
Jan 21st
j) bug in TCPConnect() with proxy. So on success connection from proxy, we
just readLines till an empty line, and take that as an indication that
from that point on its actual data from destination.
Jan 21st
k) Make the frames FRAME_NONE. Will allow window to hold more space for stuff.
Jan 21st
l) Rename /portcheck to /portcheckme
The command that basically sends a /ctcp portcheck nick 8124
Jan 21st
m) Add /portcheck <nick>
Jan 21st
n) The NODELAY Triggers should be processed ASAP. Currently they all get
queued in FIFO basis. Hence the NODELAY trigers get behind DELAY
triggers. This can cause anxiety problems in newbie users.
Simplest solution is to form another Thr and Q. Hence we create a
ToTriggerNowThr.cpp and a IRC_ToTriggerNow Q.
Then we can remove the second word in the line having to be DELAY or
NODELAY.
So for this we revert back the change to FServParse to recognise the
second word as DELAY or NODELAY.
Jan 21st
o) Changed filter. block only if server and join and # and no masala in it.
Jan 21st
p) Add buttons like in mirc, for things like:
/clear, /portcheck, /portcheckme, /dcc send
The Nick highlighted in the window is taken as the
nick to which its directed.
Jan 22nd --- Released
q) TCConnect::readData() to return -1 when it recv returns 0 bytes.
Receiving 0 bytes => socket closed on other end.
The bug that prompted the above is as follows:
I see an upload in FileServer, stuck at 100 %.
Scenario was, that I had contacted the nicks port 8124 and sending him file.
The socket is in CLOSE_WAIT
TCP 192.168.0.26:3435 24.24.197.163:8124 CLOSE_WAIT
So basically, TransferThr, calls T.run, which hasnt returned.
If it had returned, it would have removed from SendsInProgress.
something wrong in readAckBytes/TCPConnect.readData, not returning on error.
Jan 23rd
r) Add a button, which is red if firewalled. green if not.
So it starts of red, and if we get a valid incoming we gradually make
it green. As of now 5 incomings = green.
DCCServer, starts of with Firewall = 0. On getting a valid
incoming, it increases by 1 till 5, and send the UI a "*NOTFIREWALLED*"
message
Jan 23rd
s) When X pressed in window, it doesnt quit cleanly.
Make it clean gracefully.
Added addSignall() calls, and no deleting of UI in UI.cpp.
Jan 24th
t) Mirc like feature:
On clicking on a word, if such a nick exists, we select it in the NickList.
Jan 24th
u) Make messages in Server window consistent. That is instead of " * ",
put-> component: message. example: UPNP: Router detected.
Most of components done. Its ongoing, if I find something new, I will
proactively update.
Jan 24th
v) file server ad should mention its firewall state. First Ad that is
displayed on joining channel, should list UNKNOWN.
- FireWalled:[NO|nn %]
Jan 24th
w) Before Quitting, ask confirmation.
On pressing X it still abruptly quits.
Jan 25th
x) Allow user to change Partial and Serving Directories.
Add it under Dir Menu.
Side effect, trace file created only in run directory.
Jan 26th
y) Issuing a !list <nick>, we always try to get the file list.
Jan 26th
z) Pasting lines more than 320 characters get truncated.
Jan 26th
a) Crash in TCPConnect->getUploadBPS();
Again, inspite of having the lock in TCPConnect(). (Search above for bug -
Jan 19th section t)
There is a narrow window when TCPConnect:: can still be destroyed.
if (oldFD->Connection) {
after this, a different thread, TCPConnect locks and destroys.
oldFD->Connection->lock();
Lock succeeds and we try to use UploadBPS().
So possibly we can first lock, before we check oldFD->Connection
Jan 27th
b) Make IRCSERVER_TARGET_CHANGE_DELAY be 20.
Jan 27th
c) Linux portability changes.
Jan 28th
d) Made UI be updated only by the UI creating thread.
Now Linux and Windows UI behave similar, wrt scrolling.
Jan 28th
e) Made the addTimeout() process of UI updation in both Windows and unix
as they will have very similar code.
Jan 29th
f) Add "Do not attempt to exploit me." in SpamFilter.
Jan 30th
g) Allow !list <nick> and @find <str> to be visible in the windows.
Jan 30th
h) Change the orange for Trigger prints to something else. Its too close to
the red color which is not spotted.
Change it to 15 => light grey
Jan 30th
u) When there are more than one sends to a nick (manual), when one of them
completes, it removes all the entries.
Jan 30th
v) Still getting crashes in UploadBps() and DownloadBps() inspite of being
locked. Looks like the lock is not working. Maybe the lock is not using
the static lock of the TCPConnect class.
Made change from:
MUTEX TCPConnect::Mutex_TCPConnect;
to:
MUTEX TCPConnect::Mutex_TCPConnect = 0;
Maybe the first one, created one more lock rather than initialising the
static lock of class.
Jan 30th
w) As part of above, if TCP state is not TCP_ESTABLISHED; then return 0
on call to UploadBps() and DownloadBps();
Jan 30th
x) On quitting and restarting the sends and queues when quit, were not
maintained again. Bug introduced.
Moved the MyFilesDB population code before setting up queues.
Jan 30th
y) Make more messages in Server window consistent.
Jan 30th
z) In Messages window. If I click on a text which happens to be the nick,
now, it highlights the nick in the nicklist. We should also make the
label text = nick.
Jan 30th
a) Correct the Messages window once and for all.
Messages to nick appear as: <to Nick> text
Messages from nick appear as: <Nick> text
Jan 31st
b) On issuing portcheck etc, let the results be seen in the window its issued
in.
Jan 31st
c) In File Search Tab. Rename the Scan Time column as "Information".
All will have a default message of "Double click to download"
On Double Clicking it, change the message to "Check Network Tab for
details"
Feb 1st
d) In Linux, the upnp port forwarding gets an erroneous local ip address.
No it doesnt. The linux box was not configured correctly.
Its hostname had an entry in hosts to 127.0.0.2
NOT A BUG.
Feb 1st ----> Released
e) Improve on the FileSearch Tab.
Add new columns like:
Sends Queues
02/02 05/20
This firstly, introduces 2 new columns in that TAB.
Secondly, it means we need to add those information in the
FilesDetail structure.
In the ToTriggerThr, ToTriggerNowThr and FromServerThr, we first delete
NickFile(Nick, "TriggerTemplate");
then add FD with Nick and File = "TriggerTemplate", with the sends and
the queus information.
Later when we parse xdcc or fserv, we first get the
NickFile(Nick, "TriggerTemplate") FD. Note down the sends and q info.
And update each entry with that information.
In the TabBook update, we do not display the information if filename
is "TriggerTemplate"
So if we are not going to issue the trigger, we will update all files
held by the nick, with the latest sends and q information.
So have to change the FServParse class to identify the sends and queues
of xdcc iroffers and FServ Triggers.
Added a TriggerType called SENDS_QS_LINE. This will be returned by
TriggerParse.getTriggerType, so that we know what is being updated.
Feb 5th
f) Add Buttons and Toggle buttons in FileSearch.
|Search string|List Nick|List All|Free Sends|Free Qs| TEXT Entry.
All in the bottom line.
Feb 5th
g) On receiving a ctcp NoReSend, we should not requeue that send when it
disconnects.
So added IC_CTCPNORESEND
Add a flag in FilesDetailList which => no resend, bool NoResend.
add a function which updates NoResend of Nick.
The Transfer.requeueTransfer(), will check the NoResend flag, before
attempting to requeue it.
Feb 6th
h) Crash in DCCThr on ACCEPT. Was freeing something that wasnt even
allocated on a failure case.
Feb 7th
i) Pop a menu on right click. This presents options for:
-> portcheck, portcheckme, dcc send, list files, get listing
and works on the selected nick.
Feb 7th
j) Forgot to add the logic of grabbing client info and sends / queues
information in the IC_NOTICE case. Added now.
Feb 7th
k) Take care of one more xdcc sends line variation.
Feb 7th
l) There is a leak showing up at one copyFilesDetail. It was from
Transfer::requeueTransfer()
Feb 9th
m) Add the same right click popup, for the channel UI.
Feb 9th
n) When doing a /ctcp nick ping|version etc we got a message saying attempting
trigger of so and so, though it didnt really attempt.
Feb 10th
o) Move to fox 1.4.2 stable.
Feb 10th
p) Use FXGUISignal in Fox 1.4 to make GUI updations. So we remove our
up / down semaphore dance in conjunction with addTimeOut()
Feb 10th
q) Do not use FXGUISignal. Doesnt seem to work nice with Linux.
Revert back to our code.
Feb 11th
r) Added a Splash Screen during startup.
Feb 11th
s) TCPConnect() does not update the speeds when timeouts on receiving occur
and no data is transferred.
Move the update code as a private routine, and call it from relevant
places.
Feb 11th
t) On double click on the File Server tab. If in Q, ask if that needs to be
sent immediately. and handle accordingly.
Feb 11th
u) Remove the !list at start. It just creates traffic. They can do a
!list <nick>, and get the file listings. As it is !list is not permitted
from MasalaMate.
Feb 12th
v) IP remembrance to avoid many dns calls. In DCCThr.cpp, case IC_CTCPFSERV,
try to get the IP of user if it already exists in the NickList. If it
doesnt, then issue the getLongFromHostName(), to obtain it. On obtaining
it update the NickList to have that IP, so we dont issue it again.
Another feature to add is, to recognise the IP as last parameter of the ctcp
trigger. Example: /ctcp nick masala of nick IP. The ip here is in long.
If we hit a case where we are not able to obtain the nick's ip, we
use that IP as present in the trigger line. We do not save this ip with
the nick, as it might not be reliable.
Feb 13th
w) Issue the MasalaMate client trigger, appending our longip with it.
Feb 13th
x) We still get crashes when updating the UploadBPS()
This is why:
Thread 1 Thread 2
copyFilesDetail()
have a TCPConnect.
delFilesDetail entry.
delete TCPConnect.
Access TCPConnect.UploadBPS()
Crash.
So think on how to resolve this.
Above scenario does not seem possible as we always delete entry before
deleting the TCPConnect.
Looks like some other copyFilesDetail is crashing. used in Helper,
DCCChatThr, DwnldInitThr.cpp, where a variation of above scenario as
below can exist.
Thread 1 Thread 2
in copyFilesDetail()
before lock TCPConnect free FD in FilesDetailList