projects
/
quanweb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adds config file (quanlib.ini) support.
[quanweb.git]
/
main
/
handler.go
diff --git
a/main/handler.go
b/main/handler.go
index 8a74c627e96f534ba2f01ace20012601a4840cee..cd35a7640c124d2690f390ff9d9f1c92ce2fc251 100644
(file)
--- a/
main/handler.go
+++ b/
main/handler.go
@@
-29,10
+29,10
@@
func bookMimeType(bookPath string) string {
}
func efsPathForId(efsId int) string {
}
func efsPathForId(efsId int) string {
- config :=
g
etConfig()
+ config :=
G
etConfig()
idStr := fmt.Sprintf("%010d", efsId)
idStr := fmt.Sprintf("%010d", efsId)
- path := fmt.Sprintf("%s/
%s/%s/%s/%s/%s.dat", config.efsB
asePath, idStr[0:2], idStr[2:4], idStr[4:6], idStr[6:8], idStr)
+ path := fmt.Sprintf("%s/
efs/%s/%s/%s/%s/%s.dat", config.b
asePath, idStr[0:2], idStr[2:4], idStr[4:6], idStr[6:8], idStr)
return path
}
return path
}
@@
-179,7
+179,6
@@
func handleInfo(w http.ResponseWriter, r *http.Request) {
func handleSearch(w http.ResponseWriter, r *http.Request) {
var err error
func handleSearch(w http.ResponseWriter, r *http.Request) {
var err error
- fmt.Println("DEBUG: handleSearch(): " + r.URL.Path)
fields := []Field{Author, Title, Series}
fields := []Field{Author, Title, Series}
@@
-190,7
+189,6
@@
func handleSearch(w http.ResponseWriter, r *http.Request) {
paramName := fv.String()
paramValues := r.Form[paramName]
for _, pv := range(paramValues) {
paramName := fv.String()
paramValues := r.Form[paramName]
for _, pv := range(paramValues) {
- fmt.Println("DEBUG: handleSearch(): ", paramName, "=", pv)
if count >= len(terms) {
fmt.Printf("WARNING: limit of %d search terms exceeded. One or more terms ignored.", len(terms))
break
if count >= len(terms) {
fmt.Printf("WARNING: limit of %d search terms exceeded. One or more terms ignored.", len(terms))
break